Submission #00379
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #include <bits/stdc++.h> using namespace std; long long int c, n, all_flag1 = 0, all_flag2 = 0, x, y, xx, yy, ans = 0, p; char mas[11111][11111], mas2[11111][11111], temp; bool flag1[11111], flag2[11111]; int main() { cin >> c >> n; c--; for ( int i = 0; i < n; i++) { cin >> mas[i]; } for ( int i = 0; i < n; i++) { for ( int j = 0; j < n; j++) { mas2[i][j] = mas[n-1-j][i]; } } for ( int i = 0; i < n/2; i++) { if ( strcmp (mas[i], mas[n-i-1]) == 0) { flag1[i] = true ; all_flag1++; } else flag1[i] = false ; if ( strcmp (mas2[i], mas2[n-i-1]) == 0) { flag2[i] = true ; all_flag2++; } else flag2[i] = false ; } if (all_flag1 == n/2 && all_flag1 == n/2) ans++; for ( int i = 0; i < c; i++) { cin >> p; for ( int j = 0; j < p; j++) { cin >> y >> x; y--; x--; if (mas[y][x] == '1' ) mas[y][x] = '0' ; else mas[y][x] = '1' ; if (y > n/2) { yy = y; y = n-y-1; } else { yy = y; } if ( strcmp (mas[y], mas[n-y-1]) == 0 && flag1[y] == false ) { all_flag1++; flag1[y] = true ; } else if ( strcmp (mas[y], mas[n-y-1]) != 0 && flag1[y] == true ) { all_flag1--; flag1[y] = false ; } y = yy; temp = x; x = n-y-1; y = temp; if (mas2[y][x] == '1' ) mas2[y][x] = '0' ; else mas2[y][x] = '1' ; if (y > n/2) { yy = y; y = n-y-1; } if ( strcmp (mas2[y], mas2[n-y-1]) == 0 && flag2[y] == false ) { all_flag2++; flag2[y] = true ; } else if ( strcmp (mas2[y], mas2[n-y-1]) != 0 && flag2[y] == true ) { all_flag2--; flag2[y] = false ; } } if (all_flag1 == n/2 && all_flag2 == n/2) ans++; } cout << ans << endl; } |
ステータス
項目 | データ |
---|---|
問題 | 0006 - 品質管理 |
ユーザー名 | udonkun |
投稿日時 | 2016-08-29 11:57:11 |
言語 | C++11 |
状態 | Runtime Error |
得点 | 0 |
ソースコード長 | 1801 Byte |
最大実行時間 | 1992 ms |
最大メモリ使用量 | 26064 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 13 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
00-sample1.in | AC | 64 ms | 2396 KB |
1
|
00-sample2.in | AC | 60 ms | 2464 KB |
1
|
20-maxsymm01.in | RE | 1992 ms | 25960 KB |
1
|
20-maxsymm02.in | RE | 422 ms | 25908 KB |
1
|
40-symm-unsymm01.in | RE | 421 ms | 25988 KB |
1
|
40-symm-unsymm02.in | RE | 464 ms | 26064 KB |
1
|
40-symm-unsymm03.in | RE | 522 ms | 26012 KB |
1
|
40-symm-unsymm04.in | RE | 640 ms | 25960 KB |
1
|
40-symm-unsymm05.in | RE | 923 ms | 26036 KB |
1
|
40-symm-unsymm06.in | RE | 1311 ms | 25980 KB |
1
|