Submission #00189


ソースコード

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
87
88
89
90
91
92
93
94
95
96
97
#include<bits/stdc++.h>
using namespace std;
vector<int> i[10000];
vector<int> u[10000];
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
long long a,b,c,d=0,e,f,g=0;
string s[111];
cin >>a>>b;
for(int n=0;n<b;n++) cin >>s[n];
for(int n=1;n<=b/2;n++){
u[n].push_back(0);
for(int m=1;m<=b;m++){
if(s[n-1][m-1]!=s[b-1-d][m-1]) u[n].push_back(1);
else u[n].push_back(0);
}
d++;
}
for(int n=1;n<=b;n++){
d=0;
i[n].push_back(0);
for(int m=1;m<=b/2;m++){
if(s[n-1][m-1]!=s[n-1][b-1-d]) i[n].push_back(1);
else i[n].push_back(0);
d++;
}
}
d=0;
for(int n=1;n<=b;n++){
for(int m=1;m<=b/2;m++){
if(i[n][m]==1){
d++;
break;
}
}
if(d>0) break;
}
if(d==0){
for(int n=1;n<=b/2;n++){
for(int m=1;m<=b;m++){
if(u[n][m]==1){
d++;
break;
}
}
if(d>0) break;
}
if(d==0) g++;
}
for(int n=1;n<a;n++){
cin >>c;
for(int m=0;m<c;m++){
cin >>e>>f;
if(f>b/2){
if(i[e][b-f+1]==0) i[e][b-f+1]++;
else i[e][b-f+1]=0;
}
else{
if(i[e][f]==0) i[e][f]++;
else i[e][f]=0;
}
if(e>b/2){
if(u[b-e+1][f]==0) u[b-e+1][f]++;
else u[b-e+1][f]=0;
}
else{
if(u[e][f]==0) u[e][f]++;
else u[e][f]=0;
}
}
d=0;
for(int r=1;r<=b;r++){
for(int w=1;w<=b/2;w++){
if(i[r][w]==1){
d++;
break;
}
}
if(d>0) break;
}
if(d==0){
for(int r=1;r<=b/2;r++){
for(int w=1;w<=b;w++){
if(u[r][w]==1){
d++;
break;
}
}
if(d>0) break;
}
if(d==0) g++;
}
}
cout <<g<<'\n';
return (0);
}

ステータス

項目 データ
問題 0006 - 品質管理
ユーザー名 GirlyBeast
投稿日時 2019-09-10 18:33:00
言語 C++11
状態 Runtime Error
得点 0
ソースコード長 1737 Byte
最大実行時間 77 ms
最大メモリ使用量 1276 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
00-sample1.in AC 22 ms 1116 KB
1
00-sample2.in AC 24 ms 992 KB
1
20-maxsymm01.in RE 77 ms 1120 KB
1
20-maxsymm02.in RE 29 ms 996 KB
1
40-symm-unsymm01.in RE 29 ms 1000 KB
1
40-symm-unsymm02.in RE 29 ms 1268 KB
1
40-symm-unsymm03.in RE 28 ms 1276 KB
1
40-symm-unsymm04.in RE 31 ms 1152 KB
1
40-symm-unsymm05.in RE 32 ms 1164 KB
1
40-symm-unsymm06.in RE 24 ms 1044 KB
1