QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#828062#8975. Eva and Euro coinshxhhxhAC ✓35ms11648kbC++20336b2024-12-23 12:48:022024-12-23 12:48:07

Judging History

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

  • [2024-12-23 12:48:07]
  • 评测
  • 测评结果:AC
  • 用时:35ms
  • 内存:11648kb
  • [2024-12-23 12:48: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]=0,w[o]=s[i]:0,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");
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

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

input:

6 2
000000
101101

output:

Yes

result:

ok single line: 'Yes'

Test #2:

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

input:

8 3
10101010
01010101

output:

No

result:

ok single line: 'No'

Test #3:

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

input:

10 3
0100011001
0001000000

output:

Yes

result:

ok single line: 'Yes'

Test #4:

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

input:

10 3
0100001010
0000000000

output:

No

result:

ok single line: 'No'

Test #5:

score: 0
Accepted
time: 23ms
memory: 7952kb

input:

1000000 1
01010010001111000111010001001110100010010111101011100110111000101111100001111111000000001001110011101110001011110000011011101001010001111000001111110001010101011110010010100000001001100001100111111100101001101110100000001011111011011101000011111110100100000001001001110011011011000100111010...

output:

Yes

result:

ok single line: 'Yes'

Test #6:

score: 0
Accepted
time: 29ms
memory: 6532kb

input:

1000000 2
11000001010001101110110010110111011001000110110111100010011111100111111011010000000100001001010010000001110000011001101110000001010101001001111010100010110110010001000011001010000101010011111011000011000000110101111100110100101101101110110010100100011110011100001101000010011011101000000010...

output:

No

result:

ok single line: 'No'

Test #7:

score: 0
Accepted
time: 28ms
memory: 8400kb

input:

1000000 3
00000011100011100000000000000000111000000000000111001110000001110000000001110000001110000000000000000111000000000111011100000000000000000000011101111110000001110000000000000011100000000011100000000000000000000000000011100000000000111100011100000100000000111000111000000000000100000011100000...

output:

Yes

result:

ok single line: 'Yes'

Test #8:

score: 0
Accepted
time: 30ms
memory: 8348kb

input:

1000000 4
10000110000000010000110000111111111000010000111100001111111111111111111100001111111000011111111111111110000111000011111110000111111111111111111100001111111111110000111111111111111111000011111111111100001111111100000000111111111111111111111111100001110110000111111111111111111100001111100001...

output:

Yes

result:

ok single line: 'Yes'

Test #9:

score: 0
Accepted
time: 20ms
memory: 8592kb

input:

1000000 10
0000100000001111111111000000111111111100000001000001000000011111111110011111111110000000000000000011111111110000010000000000111111111011111111110000000011111111110000001111100000000001111100000001111111111000001111111111001111111111001111111111000001111111110000000000100000000000000000001...

output:

Yes

result:

ok single line: 'Yes'

Test #10:

score: 0
Accepted
time: 24ms
memory: 8112kb

input:

1000000 20
1000000000000000000001111111111100000000000000000000011111111110100000000000000000000111000000000000000000001111111100000000000000001111111111111111111100001111111111111111111111111111111111111011111111111111011111111111111111111111100000000111111111111111111110000000000001111110000000000...

output:

Yes

result:

ok single line: 'Yes'

Test #11:

score: 0
Accepted
time: 19ms
memory: 7592kb

input:

1000000 100
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #12:

score: 0
Accepted
time: 27ms
memory: 6560kb

input:

1000000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #13:

score: 0
Accepted
time: 31ms
memory: 11648kb

input:

1000000 1000000
00101011010001000010010000111101010101101011111101110111110011011110001001011010011100101111011110011011010110000010110101100100111001110110101101010011111101010111011010110000110110110101100010011100101111001101110010011000111011011110111000010011010101000100101011110110011010111011...

output:

No

result:

ok single line: 'No'

Test #14:

score: 0
Accepted
time: 35ms
memory: 10664kb

input:

1000000 999999
010101111111011011110000110100111101111011000110101100001101110010110100101000111111111001011001001111101101110111010001110010101010101110001110000001010110010110111000110101001100000110111111110000010111011110110110110010100101100010010100110111101111001101110111101000101101111000111...

output:

No

result:

ok single line: 'No'

Test #15:

score: 0
Accepted
time: 24ms
memory: 8032kb

input:

1000000 3
00000011100011100000000000000000111000000000000111001110000001110000000001110000001110000000000000000111000000000111011100000000000000000000011101111110000001110000000000000011100000000011100000000000000000000000000011100000000000111100011100000100000000111000111000000000000100000011100000...

output:

No

result:

ok single line: 'No'

Test #16:

score: 0
Accepted
time: 25ms
memory: 10500kb

input:

1000000 4
10000110000000010000110000111111111000010000111100001111111111111111111100001111111000011111111111111110000111000011111110000111111111111111111100001111111111110000111111111111111111000011111111111100001111111100000000111111111111111111111111100001110110000111111111111111111100001111100001...

output:

No

result:

ok single line: 'No'

Test #17:

score: 0
Accepted
time: 28ms
memory: 8128kb

input:

1000000 10
0000100000001111111111000000111111111100000001000001000000011111111110011111111110000000000000000011111111110000010000000000111111111011111111110000000011111111110000001111100000000001111100000001111111111000001111111111001111111111001111111111000001111111110000000000100000000000000000001...

output:

No

result:

ok single line: 'No'

Test #18:

score: 0
Accepted
time: 28ms
memory: 6596kb

input:

1000000 20
1000000000000000000001111111111100000000000000000000011111111110100000000000000000000111000000000000000000001111111100000000000000001111111111111111111100001111111111111111111111111111111111111011111111111111011111111111111111111111100000000111111111111111111110000000000001111110000000000...

output:

No

result:

ok single line: 'No'

Test #19:

score: 0
Accepted
time: 27ms
memory: 8420kb

input:

1000000 100
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111...

output:

No

result:

ok single line: 'No'

Test #20:

score: 0
Accepted
time: 22ms
memory: 8328kb

input:

1000000 200
000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000001111111111111111111...

output:

No

result:

ok single line: 'No'

Test #21:

score: 0
Accepted
time: 23ms
memory: 8052kb

input:

1000000 1000000
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #22:

score: 0
Accepted
time: 27ms
memory: 7660kb

input:

1000000 999999
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

No

result:

ok single line: 'No'

Extra Test:

score: 0
Extra Test Passed