QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#828059#8975. Eva and Euro coinshxhhxhWA 27ms12012kbC++20334b2024-12-23 12:47:022024-12-23 12:47:03

Judging History

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

  • [2024-12-23 12:47:03]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:12012kb
  • [2024-12-23 12:47:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,k,p[1000006],w[1000006],o,v;
char s[1000006];
int slv(){
	cin>>s;
	for(int i=o=v=0;i<n;i++) w[o]!=s[i]?p[++o]=1,w[o]=s[i]:o-=++p[o]==k;
	for(int i=1;i<=o;i++) v=(v<<17)^(v>>13)^(v<<8)^(p[i]<<5)^w[i];
	return v;
}
int main(){
	cin>>n>>k;
	puts(slv()==slv()?"Yes":"No");
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6 2
000000
101101

output:

Yes

result:

ok single line: 'Yes'

Test #2:

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

input:

8 3
10101010
01010101

output:

No

result:

ok single line: 'No'

Test #3:

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

input:

10 3
0100011001
0001000000

output:

Yes

result:

ok single line: 'Yes'

Test #4:

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

input:

10 3
0100001010
0000000000

output:

No

result:

ok single line: 'No'

Test #5:

score: -100
Wrong Answer
time: 27ms
memory: 12012kb

input:

1000000 1
01010010001111000111010001001110100010010111101011100110111000101111100001111111000000001001110011101110001011110000011011101001010001111000001111110001010101011110010010100000001001100001100111111100101001101110100000001011111011011101000011111110100100000001001001110011011011000100111010...

output:

No

result:

wrong answer 1st lines differ - expected: 'Yes', found: 'No'