문제
URL : https://codeup.kr/problemsetsol.php?psid=23
소스코드
// 바둑판에 흰돌 놓기
// input : 5
// 1 1
// 2 2
// 3 3
// 4 4
// 5 5
// output : 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// 설명 :
#include <iostream>
using namespace std;
int main()
{
int badook[19][19] = { 0 };
int n;
cin >> n;
for (int s = 0, i, k; s < n; s++)
{
cin >> i >> k;
badook[i - 1][k - 1] = 1;
}
for (int i = 0; i < 19; i++) {
for (int k = 0; k < 19; k++) {
cout << badook[i][k] << " ";
}
cout << endl;
}
return 0;
}