Submission #00349


ソースコード

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
77
78
79
80
81
82
83
84
85
86
#include <map>
#include <set>
#include <list>
#include <cstdio>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cctype>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
#define fr first
#define sc second
#define mp make_pair
typedef long long int64;
typedef pair< int, int > iP;
typedef pair< iP, int > iiP;
const int INF = 2 << 28;
const double EPS = 1e-10;
bool check(int flag[], int N) {
for(int i = 0; i < N; i++) {
if(flag[i]) return false;
}
return true;
}
int main() {
int C, N;
char p[1001][1001];
cin >> C >> N;
for(int i = 0; i < N; i++) {
for(int j = 0; j < N; j++) {
cin >> p[i][j];
}
}
int cnt = 0;
int flag[1001] = { 0 };
vector< pair< int, int > > v;
for(int i = 0; i < N / 2; i++) {
for(int j = 0; j < N / 2; j++) {
if(!(p[i][j] == p[N - i - 1][j]) && (p[i][j] == p[i][N - j - 1] && p[i][j] == p[N - i - 1][N - j - 1])) {
flag[i] |= 1 << j;
}
}
}
if(check(flag, N / 2)) cnt++;
while(--C) {
int D; cin >> D;
while(D--) {
int r, c; cin >> r >> c;
if(p[r - 1][c - 1] == '0') p[r - 1][c - 1] = '1';
else p[r - 1][c - 1] = '0';
if(r > N / 2) r = N - r + 1;
if(c > N / 2) c = N - c + 1;
r--, c--;
if(!(p[r][c] == p[N - r - 1][c] && p[r][c] == p[r][N - c - 1] && p[r][c] == p[N - r - 1][N - c - 1])) {
flag[r] |= 1 << c;
} else {
flag[r] &= ~(1 << c);
}
}
if(check(flag, N / 2)) cnt++;
}
cout << cnt << endl;
}

ステータス

項目 データ
問題 0006 - 品質管理
ユーザー名 Jogasaki_Mika_Tanto_P
投稿日時 2016-08-29 11:42:02
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 1946 Byte
最大実行時間 369 ms
最大メモリ使用量 1548 KB

セット

セット 得点 Cases
1 ALL 0 / 13 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
00-sample1.in AC 23 ms 472 KB
1
00-sample2.in AC 27 ms 692 KB
1
20-maxsymm01.in AC 369 ms 1548 KB
1
20-maxsymm02.in AC 364 ms 1440 KB
1
40-symm-unsymm01.in AC 115 ms 1464 KB
1
40-symm-unsymm02.in WA 199 ms 1484 KB
1
40-symm-unsymm03.in AC 242 ms 1508 KB
1
40-symm-unsymm04.in WA 244 ms 1404 KB
1
40-symm-unsymm05.in WA 250 ms 1424 KB
1
40-symm-unsymm06.in WA 235 ms 1448 KB
1