QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#142188#6376. LaLa and Lampc1120241725WA 1ms3636kbC++14840b2023-08-18 16:49:452023-08-18 16:49:52

Judging History

This is the latest submission verdict.

  • [2023-08-18 16:49:52]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3636kb
  • [2023-08-18 16:49:45]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
inline int read(){
    int s=0,w=1;char ch=getchar();
    for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')w=-w;
    for(;ch>='0'&&ch<='9';ch=getchar())s=s*10+ch-'0';
    return s*w;
}
inline void write(int x){
    if(x<0)x=-x,putchar('-');
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
int n;
int a[2001][2001];
int way[6][2]={{0,0},{0,1},{1,0},{1,2},{2,1},{2,2}};
int main(){
	n=read();
	for(int i=1;i<=n;++i)for(int j=1;j<=i;++j){
		char ch;cin>>ch;a[i][j]=ch-'0';
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=i;++j){
			int res=0;
			for(int k=0;k<6;++k){
				int tx=i+way[k][0],ty=j+way[k][1];
				if(tx<1||ty<1||tx>n||ty>i){
					res=0;break;
				}
				res^=a[tx][ty];
			}
			if(res){
				puts("No");
				exit(0);
			}
		}
	}
	puts("Yes");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3424kb

input:

6
0
00
000
0110
00100
000000

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3420kb

input:

2
0
11

output:

Yes

result:

ok answer is YES

Test #3:

score: 0
Accepted
time: 1ms
memory: 3416kb

input:

3
1
10
011

output:

Yes

result:

ok answer is YES

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 3636kb

input:

4
1
11
101
0101

output:

Yes

result:

wrong answer expected NO, found YES