QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#358913#6376. LaLa and Lampucup-team266WA 1ms3672kbC++231.3kb2024-03-20 08:30:462024-03-20 08:30:46

Judging History

你现在查看的是最新测评结果

  • [2024-03-20 08:30:46]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3672kb
  • [2024-03-20 08:30:46]
  • 提交

answer

//Author: Kevin5307
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
namespace _kv_hash
{
	const ull mask=std::chrono::steady_clock::now().time_since_epoch().count();
	ull shift(ull x)
	{
		x^=mask;
		x^=x<<13;
		x^=x>>7;
		x^=x<<17;
		x^=mask;
		return x;
	}
}
using namespace _kv_hash;
int n;
char s[2020][2020];
pii rotate(int x,int y)
{
	return mp(n+y-x,n+1-x);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%s",s[i]+1);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=i;j++)
		{
			int a=rotate(i,j).first,b=rotate(i,j).second;
			int x=rotate(a,b).first,y=rotate(a,b).second;
			int sum=(s[i][j]-'0')+(s[a][b]-'0')+(s[x][y]-'0');
			if(sum%2)
				die("No");
		}
	die("Yes");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3672kb

input:

6
0
00
000
0110
00100
000000

output:

No

result:

wrong answer expected YES, found NO