@@ -6,34 +6,34 @@ using namespace std;
6
6
7
7
int N;
8
8
int paper[2200 ][2200 ];
9
- int cnt[3 ]; // -1, 0, 1로 채워진 종이 갯수
9
+ int cnt[3 ]; // -1, 0, 1로 채워진 종이 갯수
10
10
11
- // 해당 종이 내부에 같은 숫자로만 채워졌는지 확인하는 함수
11
+ // 해당 종이 내부에 같은 숫자로만 채워졌는지 확인하는 함수
12
12
bool check (int x, int y, int n) {
13
13
for (int i = x; i < x + n; i++)
14
- for (int j = y; j < y + n; j++)
15
- if (paper[x][y] != paper[i][j])
16
- return false ;
14
+ for (int j = y; j < y + n; j++)
15
+ if (paper[x][y] != paper[i][j])
16
+ return false ;
17
17
return true ;
18
18
}
19
19
void solve (int x, int y, int z)
20
20
{
21
21
if (check (x, y, z)) {
22
- cnt[paper[x][y] + 1 ] += 1 ;
23
- return ;
24
- }
22
+ cnt[paper[x][y] + 1 ] += 1 ;
23
+ return ;
24
+ }
25
25
int n = z / 3 ;
26
26
for (int i = 0 ; i < 3 ; i++)
27
- for (int j = 0 ; j < 3 ; j++)
28
- solve (x + i * n, y + j * n, n);
27
+ for (int j = 0 ; j < 3 ; j++)
28
+ solve (x + i * n, y + j * n, n);
29
29
}
30
30
int main (void ) {
31
31
ios::sync_with_stdio (0 );
32
32
cin.tie (0 );
33
33
cin >> N;
34
34
for (int i = 0 ; i < N; i++)
35
- for (int j = 0 ; j < N; j++)
36
- cin >> paper[i][j];
35
+ for (int j = 0 ; j < N; j++)
36
+ cin >> paper[i][j];
37
37
solve (0 , 0 , N);
38
38
for (int i = 0 ; i < 3 ; i++) cout << cnt[i] << " \n " ;
39
- }
39
+ }
0 commit comments