Submission #00386


ソースコード

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
#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;
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, stat = 0;
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])) {
stat++;
}
}
}
if(!stat) cnt++;
while(--C) {
int D; cin >> D;
while(D--) {
int r, c; cin >> r >> c;
int y = r, x = c;
if(r > N / 2) r = N - r + 1;
if(c > N / 2) c = N - c + 1;
r--, c--;
bool before = (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]);
if(p[y - 1][x - 1] == '0') p[y - 1][x - 1] = '1';
else p[y - 1][x - 1] = '0';
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]) {
if(!before) stat++;
} else {
if(before) stat--;
}
cout << stat << endl;
}
if(!stat) cnt++;
}
cout << cnt << endl;
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
00-sample1.in WA 20 ms 476 KB
1
00-sample2.in AC 19 ms 440 KB
1
20-maxsymm01.in WA 1429 ms 4252 KB
1
20-maxsymm02.in WA 1519 ms 6832 KB
1
40-symm-unsymm01.in WA 676 ms 7364 KB
1
40-symm-unsymm02.in WA 1115 ms 8672 KB
1
40-symm-unsymm03.in WA 883 ms 10488 KB
1
40-symm-unsymm04.in WA 1197 ms 12040 KB
1
40-symm-unsymm05.in WA 2415 ms 13984 KB
1
40-symm-unsymm06.in WA 907 ms 15424 KB
1