QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#832787#8975. Eva and Euro coinsKazemaruAC ✓20ms21636kbC++23404b2024-12-26 08:01:022024-12-26 08:01:02

Judging History

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

  • [2024-12-26 08:01:02]
  • 评测
  • 测评结果:AC
  • 用时:20ms
  • 内存:21636kb
  • [2024-12-26 08:01:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,j,k) for(int i=j;i<=k;++i)
#define g(i,j,k) for(int i=j;i>=k;--i)
int n,m,s,l;
char c[1<<22];
vector<int>gt(){
	scanf("%s",c+1);
	vector<int>a(n);a[s=0]=1;
	f(i,1,n)if((c[i]^c[i-1])&1)(a[s]==(l=(i-a[s])%m+a[s])&&s)?(a[s--]=0):(a[++s]=l);
	return a;
}
signed main(){
	cin>>n>>m;n+=9;
	puts(gt()==gt()?"Yes":"No");
	return 0;
}

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

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3732kb

input:

6 2
000000
101101

output:

Yes

result:

ok single line: 'Yes'

Test #2:

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

input:

8 3
10101010
01010101

output:

No

result:

ok single line: 'No'

Test #3:

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

input:

10 3
0100011001
0001000000

output:

Yes

result:

ok single line: 'Yes'

Test #4:

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

input:

10 3
0100001010
0000000000

output:

No

result:

ok single line: 'No'

Test #5:

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

input:

1000000 1
01010010001111000111010001001110100010010111101011100110111000101111100001111111000000001001110011101110001011110000011011101001010001111000001111110001010101011110010010100000001001100001100111111100101001101110100000001011111011011101000011111110100100000001001001110011011011000100111010...

output:

Yes

result:

ok single line: 'Yes'

Test #6:

score: 0
Accepted
time: 18ms
memory: 19956kb

input:

1000000 2
11000001010001101110110010110111011001000110110111100010011111100111111011010000000100001001010010000001110000011001101110000001010101001001111010100010110110010001000011001010000101010011111011000011000000110101111100110100101101101110110010100100011110011100001101000010011011101000000010...

output:

No

result:

ok single line: 'No'

Test #7:

score: 0
Accepted
time: 10ms
memory: 21380kb

input:

1000000 3
00000011100011100000000000000000111000000000000111001110000001110000000001110000001110000000000000000111000000000111011100000000000000000000011101111110000001110000000000000011100000000011100000000000000000000000000011100000000000111100011100000100000000111000111000000000000100000011100000...

output:

Yes

result:

ok single line: 'Yes'

Test #8:

score: 0
Accepted
time: 9ms
memory: 19976kb

input:

1000000 4
10000110000000010000110000111111111000010000111100001111111111111111111100001111111000011111111111111110000111000011111110000111111111111111111100001111111111110000111111111111111111000011111111111100001111111100000000111111111111111111111111100001110110000111111111111111111100001111100001...

output:

Yes

result:

ok single line: 'Yes'

Test #9:

score: 0
Accepted
time: 10ms
memory: 19704kb

input:

1000000 10
0000100000001111111111000000111111111100000001000001000000011111111110011111111110000000000000000011111111110000010000000000111111111011111111110000000011111111110000001111100000000001111100000001111111111000001111111111001111111111001111111111000001111111110000000000100000000000000000001...

output:

Yes

result:

ok single line: 'Yes'

Test #10:

score: 0
Accepted
time: 8ms
memory: 19712kb

input:

1000000 20
1000000000000000000001111111111100000000000000000000011111111110100000000000000000000111000000000000000000001111111100000000000000001111111111111111111100001111111111111111111111111111111111111011111111111111011111111111111111111111100000000111111111111111111110000000000001111110000000000...

output:

Yes

result:

ok single line: 'Yes'

Test #11:

score: 0
Accepted
time: 3ms
memory: 19804kb

input:

1000000 100
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #12:

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

input:

1000000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #13:

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

input:

1000000 1000000
00101011010001000010010000111101010101101011111101110111110011011110001001011010011100101111011110011011010110000010110101100100111001110110101101010011111101010111011010110000110110110101100010011100101111001101110010011000111011011110111000010011010101000100101011110110011010111011...

output:

No

result:

ok single line: 'No'

Test #14:

score: 0
Accepted
time: 13ms
memory: 21244kb

input:

1000000 999999
010101111111011011110000110100111101111011000110101100001101110010110100101000111111111001011001001111101101110111010001110010101010101110001110000001010110010110111000110101001100000110111111110000010111011110110110110010100101100010010100110111101111001101110111101000101101111000111...

output:

No

result:

ok single line: 'No'

Test #15:

score: 0
Accepted
time: 6ms
memory: 21636kb

input:

1000000 3
00000011100011100000000000000000111000000000000111001110000001110000000001110000001110000000000000000111000000000111011100000000000000000000011101111110000001110000000000000011100000000011100000000000000000000000000011100000000000111100011100000100000000111000111000000000000100000011100000...

output:

No

result:

ok single line: 'No'

Test #16:

score: 0
Accepted
time: 3ms
memory: 21036kb

input:

1000000 4
10000110000000010000110000111111111000010000111100001111111111111111111100001111111000011111111111111110000111000011111110000111111111111111111100001111111111110000111111111111111111000011111111111100001111111100000000111111111111111111111111100001110110000111111111111111111100001111100001...

output:

No

result:

ok single line: 'No'

Test #17:

score: 0
Accepted
time: 6ms
memory: 21432kb

input:

1000000 10
0000100000001111111111000000111111111100000001000001000000011111111110011111111110000000000000000011111111110000010000000000111111111011111111110000000011111111110000001111100000000001111100000001111111111000001111111111001111111111001111111111000001111111110000000000100000000000000000001...

output:

No

result:

ok single line: 'No'

Test #18:

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

input:

1000000 20
1000000000000000000001111111111100000000000000000000011111111110100000000000000000000111000000000000000000001111111100000000000000001111111111111111111100001111111111111111111111111111111111111011111111111111011111111111111111111111100000000111111111111111111110000000000001111110000000000...

output:

No

result:

ok single line: 'No'

Test #19:

score: 0
Accepted
time: 10ms
memory: 20108kb

input:

1000000 100
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111...

output:

No

result:

ok single line: 'No'

Test #20:

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

input:

1000000 200
000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000001111111111111111111...

output:

No

result:

ok single line: 'No'

Test #21:

score: 0
Accepted
time: 7ms
memory: 21152kb

input:

1000000 1000000
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #22:

score: 0
Accepted
time: 3ms
memory: 21424kb

input:

1000000 999999
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

No

result:

ok single line: 'No'

Extra Test:

score: 0
Extra Test Passed