QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#130093 | #6376. LaLa and Lamp | xgnd | RE | 6ms | 7404kb | C++14 | 646b | 2023-07-23 16:12:37 | 2023-07-23 16:12:40 |
Judging History
answer
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn=2005,INF=0x3f3f3f3f,mod=998244853;
int _;
int n,m;
bool g[maxn][maxn];
int main(){
ios::sync_with_stdio(0);
cin>>n;
for(int i=1;i<=n;i++){
string s;
cin>>s;
for(int j=1;j<=n;j++){
g[i][j]=s[j-1]-'0';
}
}
for(int i=2;i<=n-1;i++){
for(int j=2;j<=i-1;j++){
if(g[i-1][j-1]^g[i-1][j]^g[i][j-1]^g[i+1][j]^g[i][j+1]^g[i+1][j+1]!=0){
cout<<"No";
return 0;
}
}
}
cout<<"Yes";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3536kb
input:
6 0 00 000 0110 00100 000000
output:
Yes
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
2 0 11
output:
Yes
result:
ok answer is YES
Test #3:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
3 1 10 011
output:
Yes
result:
ok answer is YES
Test #4:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
4 1 11 101 0101
output:
No
result:
ok answer is NO
Test #5:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
5 0 11 010 0011 11100
output:
No
result:
ok answer is NO
Test #6:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
6 0 10 100 1011 00001 010101
output:
No
result:
ok answer is NO
Test #7:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
7 0 01 101 0010 11000 010100 0111101
output:
No
result:
ok answer is NO
Test #8:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
8 0 01 100 1111 10011 001010 1000010 00001101
output:
No
result:
ok answer is NO
Test #9:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
9 1 00 111 0000 11110 100011 0100101 01010001 010111101
output:
No
result:
ok answer is NO
Test #10:
score: 0
Accepted
time: 0ms
memory: 3448kb
input:
10 1 01 011 1101 01011 000111 1111000 11111111 000010010 0011001100
output:
No
result:
ok answer is NO
Test #11:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
11 1 11 001 0001 00011 111000 1101001 10100101 100111110 1000001011 11110011111
output:
No
result:
ok answer is NO
Test #12:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
12 0 01 111 0101 01110 011000 1001010 10010001 011011000 1110110101 10101101110 111100100111
output:
Yes
result:
ok answer is YES
Test #13:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
13 0 00 010 0011 11101 101000 0000011 00101011 010000100 0100100100 10001100100 011011100100 1110000011011
output:
No
result:
ok answer is NO
Test #14:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
14 0 01 111 1111 01101 011000 0101111 00001110 011011001 1110000010 00111000101 110010101011 1100100011001 11001011100011
output:
No
result:
ok answer is NO
Test #15:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
15 0 10 011 0111 10100 000011 0010100 11100010 111000001 1111001011 11111110000 000110001111 0011101111100 11001101011011 010100101111110
output:
No
result:
ok answer is NO
Test #16:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
16 0 11 101 1000 01100 100010 1101111 01110101 010001000 0000110011 10011110010 101001000101 1011011111100 11110000011011 110000010111010 0111001011100110
output:
No
result:
ok answer is NO
Test #17:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
17 0 11 110 0110 10110 110111 0110100 01001100 010111101 0101011110 01010011000 010110010101 1010111110001 01010000111000 001011110101010 0110111101110000 01001111011000101
output:
No
result:
ok answer is NO
Test #18:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
18 1 01 100 0011 00100 001011 0100100 11011011 100100101 1100100111 01100100011 010011010101 1010011000110 11010011100001 011010010101111 0100101111001100 00000101011110101 011011011101111000
output:
No
result:
ok answer is NO
Test #19:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
19 0 10 110 0011 01001 110110 1000111 10010001 100001000 1111000001 01110010000 101100100001 1100001100110 01010000101000 010101111011111 0100000100110111 00111110110001000 111110010011000001 1010011010101000101
output:
No
result:
ok answer is NO
Test #20:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
20 1 01 000 1100 01011 011010 1111001 11000001 110110000 0010101100 01010010101 000100011000 1100110111101 01011111001100 011010001011101 1111001101110111 01000001011011101 100110000110001001 0000101100011011110 01000010101001110001
output:
No
result:
ok answer is NO
Test #21:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
2 0 00
output:
Yes
result:
ok answer is YES
Test #22:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
3 1 11 010
output:
Yes
result:
ok answer is YES
Test #23:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
4 1 10 000 0100
output:
Yes
result:
ok answer is YES
Test #24:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
5 0 11 011 1100 01111
output:
No
result:
ok answer is NO
Test #25:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
6 1 00 100 1101 00101 000110
output:
No
result:
ok answer is NO
Test #26:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
7 1 10 000 1011 00011 001101 0101111
output:
Yes
result:
ok answer is YES
Test #27:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
8 1 11 101 0010 00001 011001 0110111 00100011
output:
No
result:
ok answer is NO
Test #28:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
9 1 00 010 1010 10000 000100 1001110 10000111 010000110
output:
No
result:
ok answer is NO
Test #29:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
10 0 11 101 1110 11001 100100 0011001 11111100 101111111 1000100100
output:
No
result:
ok answer is NO
Test #30:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
11 0 10 000 0111 10000 100101 1110011 00110010 000100110 1000001110 10100110001
output:
No
result:
ok answer is NO
Test #31:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
12 0 01 110 0101 01001 010110 1001000 11110111 101101110 0011011110 01000100011 110011101100
output:
No
result:
ok answer is NO
Test #32:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
13 1 11 011 0101 10110 101111 0011110 10000000 101000011 0101111010 11000110111 000000101101 1001111100111
output:
No
result:
ok answer is NO
Test #33:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
14 0 00 011 0010 01111 101010 0111010 00110101 000011111 0110110101 11011000000 111110110100 0001011100010 00011110110001
output:
No
result:
ok answer is NO
Test #34:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
15 1 11 101 1110 10110 000110 1011000 01100101 000011110 0011101000 10100000100 100100100011 0000101101100 11000111110011 010111100110010
output:
Yes
result:
ok answer is YES
Test #35:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
16 0 00 011 0111 00101 001001 0111011 11101100 111110111 0101001100 01111101110 011001100010 1111101101000 01000001111010 001011010100010 1010100000110110
output:
No
result:
ok answer is NO
Test #36:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
17 1 11 000 1110 11100 011000 1000100 00101000 010111100 1010111100 10011101010 000101101110 1010001001000 01010111111000 101111111100010 0110011111011001 00010001100110101
output:
No
result:
ok answer is NO
Test #37:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
18 1 10 100 0100 00101 011010 0101111 01000101 111110100 1011110100 01011011001 100000101000 0011010000001 01111111111000 100111100101110 1111110010101100 00001111111100101 110101111011010111
output:
No
result:
ok answer is NO
Test #38:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
19 0 00 001 1011 01111 000111 0010110 00110110 010001010 1000011101 10011111100 100100011110 0010100100101 11101010101101 101010110111101 0000101110011101 00100100000100010 001100111101011101 0100011111001011100
output:
No
result:
ok answer is NO
Test #39:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
20 1 00 000 1011 01011 001001 1101110 11110111 111101111 0011010111 00100011100 000011101100 1101111001110 10111000100110 000011111101101 1011010110101001 01001011001110110 101011000010001000 1100011010001011010 00001101111100100000
output:
No
result:
ok answer is NO
Test #40:
score: 0
Accepted
time: 1ms
memory: 3400kb
input:
2 1 01
output:
Yes
result:
ok answer is YES
Test #41:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
3 1 00 101
output:
Yes
result:
ok answer is YES
Test #42:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
4 1 01 110 0110
output:
Yes
result:
ok answer is YES
Test #43:
score: 0
Accepted
time: 0ms
memory: 3480kb
input:
5 0 00 000 1110 11100
output:
Yes
result:
ok answer is YES
Test #44:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
6 0 11 101 0101 00101 110011
output:
No
result:
ok answer is NO
Test #45:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
7 1 11 011 0110 01111 110101 1000001
output:
No
result:
ok answer is NO
Test #46:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
8 1 10 100 0010 11110 011000 1101010 11110000
output:
No
result:
ok answer is NO
Test #47:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
9 0 00 100 1101 01110 010110 0011000 00000100 100111100
output:
Yes
result:
ok answer is YES
Test #48:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
10 0 10 000 1011 10100 001110 0000101 00010010 100111101 0101100011
output:
No
result:
ok answer is NO
Test #49:
score: 0
Accepted
time: 0ms
memory: 3480kb
input:
11 1 10 100 0100 00101 110001 0000001 10001111 010010011 0101010101 00100100111
output:
No
result:
ok answer is NO
Test #50:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
12 0 00 001 1010 00110 101110 1111110 10100001 011100000 0001100011 10101100100 001101101011
output:
No
result:
ok answer is NO
Test #51:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
13 1 11 011 1111 01000 110101 1100011 11001010 000011010 0001011000 00000111010 011100001111 1011010010100
output:
No
result:
ok answer is NO
Test #52:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
14 1 00 111 0100 00001 110110 0011000 00000111 101010011 1100110100 01000001000 111000010001 0010111000110 01111000110100
output:
No
result:
ok answer is NO
Test #53:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
15 1 01 001 1100 11100 100111 1100010 11010011 000011010 0111100100 10100001101 000101111011 0001011100111 01101110110110 100010011010110
output:
No
result:
ok answer is NO
Test #54:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
16 0 00 110 1101 10011 100110 0000111 11001000 101010110 1001101010 00000010010 101100011100 1001011111111 00000000111001 010011010110101 1110100110101100
output:
No
result:
ok answer is NO
Test #55:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
17 1 01 100 0111 00001 110011 0010110 00100011 101001001 0110011101 00000110101 001101100101 0010111000101 01011101111011 100110111111001 0111100011111101 01110110100001011
output:
Yes
result:
ok answer is YES
Test #56:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
18 0 10 000 1100 11010 110111 0010010 00100110 010110001 1001100000 00000111100 010010000100 0001000001010 10111100010110 011010100101110 1000000101011110 01110100110111110 111100011110000001
output:
Yes
result:
ok answer is YES
Test #57:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
19 0 01 100 1110 11100 011000 0110001 00010000 010100010 0010110110 10001000101 101010010011 1010000110101 00010001111000 100010001110100 1000110001111010 10011011100101011 101011111100110101 1000110110001110010
output:
No
result:
ok answer is NO
Test #58:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
20 1 00 011 0101 10111 110010 0000110 00010001 000111110 0110011111 11011011101 011110100110 1101010101100 01111101000101 110101101101000 1000001100110011 10101001110000100 101111101011101011 1011011000000111101 00110011010110001000
output:
No
result:
ok answer is NO
Test #59:
score: 0
Accepted
time: 6ms
memory: 7320kb
input:
1950 1 01 100 1000 01111 111110 0011100 00100110 101010011 0110111000 10001101110 100000111101 0000010011010 11000111010100 001001101001001 1101011001110011 11010001111111000 010100100011101111 0110110000100111111 10001100110101100000 011111001010111011110 1000010010010010100011 00000111011100110100...
output:
No
result:
ok answer is NO
Test #60:
score: 0
Accepted
time: 0ms
memory: 7316kb
input:
1951 1 01 010 1111 10100 101000 1010011 11000001 101010011 0000111110 00001111100 111100000001 0100101100100 00001010001011 100101001101100 0010100011111000 10011111110111011 000100100100000101 0010010011100110000 11100001111000001001 000100011110001100001 1110110111100011001101 11000010010101110000...
output:
No
result:
ok answer is NO
Test #61:
score: 0
Accepted
time: 3ms
memory: 7324kb
input:
1952 0 10 001 0111 01011 101101 0100001 00111000 000001011 1001101100 11010100010 011100111111 0010000000101 11110110001111 011000101100101 1101011101001110 00001101100011000 000111110001001010 0110100110100010000 00101101000001011011 011100001010100110010 1010000110000000011110 11001001000101001000...
output:
Yes
result:
ok answer is YES
Test #62:
score: 0
Accepted
time: 0ms
memory: 7404kb
input:
1953 1 01 010 1110 11101 000001 0001011 01000001 111000111 1100010001 11101111110 100100100000 1001010000100 11000110011110 100000000100000 1110010010100110 10110001000100110 000110011001000011 0000110001010111000 01001000000001001000 111000001001000000100 1000111010001110001001 00000100101000100010...
output:
No
result:
ok answer is NO
Test #63:
score: 0
Accepted
time: 5ms
memory: 7332kb
input:
1954 1 11 110 1101 11011 101001 0110011 10000111 111101111 0100111111 00010011111 110000100000 1010101011110 00011110100011 001110110100110 0010100110101101 10100000110111011 100110111001101000 0111100111000110001 01110111000101111100 011100000111111100111 0000110000110100101111 00110010000100010111...
output:
No
result:
ok answer is NO
Test #64:
score: 0
Accepted
time: 3ms
memory: 7276kb
input:
1955 1 00 001 1110 11101 101110 1110110 10001010 001001101 1000010110 10110110101 100011011010 1110011010110 01010001000110 100010011101010 1011110001111111 10111001010100100 011001011100010011 0100010100110010011 00111100011100010110 110110100100010111111 0101001110110000010100 00111100000111100100...
output:
No
result:
ok answer is NO
Test #65:
score: -100
Runtime Error
input:
1956 1 00 010 0110 01110 011111 0000010 01000111 111001101 0100100110 00011110000 101101011101 1001111111001 10001010110000 111111111011101 1011101011111000 11100111101001101 110010010000100111 0101111001011110011 00010101111101011011 101100000010000001010 0001110100110101010110 10110100010000000010...