QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#354373 | #8338. Quad Kingdoms Chess | ship2077 | WA | 1ms | 3676kb | C++14 | 607b | 2024-03-15 11:05:40 | 2024-03-15 11:05:41 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int M=1e5+5;
int m,op,x,y,n[2],a[3][M];
int main(){
scanf("%d",&n[1]);
for (int i=1;i<=n[1];i++) scanf("%d",&a[1][i]);
scanf("%d",&n[2]);
for (int i=1;i<=n[2];i++) scanf("%d",&a[2][i]);
scanf("%d",&m);
for (int i=1;i<=m;i++){
scanf("%d%d%d",&op,&x,&y);a[op][x]=y;
unsigned long long hash1=0,hash2=0;int mx1=0,mx2=0;
for (int i=n[1];i;i--) if (a[1][i]>mx1) hash1=hash1*233+a[1][i],mx1=a[1][i];
for (int i=n[2];i;i--) if (a[2][i]>mx2) hash2=hash2*233+a[2][i],mx2=a[2][i];
puts(hash1==hash2?"YES":"NO");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3676kb
input:
5 1 2 3 4 5 5 5 4 3 2 1 8 1 1 5 1 4 2 1 2 4 1 5 1 1 5 5 2 1 4 2 3 5 2 5 5
output:
NO NO NO NO NO NO NO YES
result:
wrong answer 4th words differ - expected: 'YES', found: 'NO'