문제 링크입니다: www.acmicpc.net/problem/14652
14652번: 나는 행복합니다~
첫째 줄에 관중석의 크기를 나타내는 N, M과 잃어버린 관중석 번호를 나타내는 K가 주어진다. (1 <= N, M <= 30,000, 0 <= K <= N*M-1)
www.acmicpc.net
간단한 수학 문제였습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
int N, M, K; | |
cin >> N >> M >> K; | |
int row = K / M; | |
int col = K % M; | |
cout << row << " " << col << "\n"; | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 15964번 이상한 기호 (0) | 2021.03.07 |
---|---|
백준 14928번 큰 수 (BIG) (0) | 2021.03.06 |
BOJ 10757번 큰 수 A+B (0) | 2021.03.06 |
백준 8437번 Julka (C++) (1) | 2021.03.06 |
백준 6749번 Next in line (0) | 2021.03.06 |