QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#832814#8975. Eva and Euro coinsKazemaruAC ✓14ms21980kbC++14419b2024-12-26 08:49:472024-12-26 08:49:48

Judging History

This is the latest submission verdict.

  • [2024-12-26 08:49:48]
  • Judged
  • Verdict: AC
  • Time: 14ms
  • Memory: 21980kb
  • [2024-12-26 08:49:47]
  • Submitted

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]=n;
	f(i,1,n)if((c[i]^c[i-1])&1){
		if(a[s]==i%m)a[s--]=0;
		else a[++s]=i%m;
	}
	return a;
}
signed main(){
	cin>>n>>m;n+=9;
	puts(gt()==gt()?"Yes":"No");
	return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6 2
000000
101101

output:

Yes

result:

ok single line: 'Yes'

Test #2:

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

input:

8 3
10101010
01010101

output:

No

result:

ok single line: 'No'

Test #3:

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

input:

10 3
0100011001
0001000000

output:

Yes

result:

ok single line: 'Yes'

Test #4:

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

input:

10 3
0100001010
0000000000

output:

No

result:

ok single line: 'No'

Test #5:

score: 0
Accepted
time: 11ms
memory: 19988kb

input:

1000000 1
01010010001111000111010001001110100010010111101011100110111000101111100001111111000000001001110011101110001011110000011011101001010001111000001111110001010101011110010010100000001001100001100111111100101001101110100000001011111011011101000011111110100100000001001001110011011011000100111010...

output:

Yes

result:

ok single line: 'Yes'

Test #6:

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

input:

1000000 2
11000001010001101110110010110111011001000110110111100010011111100111111011010000000100001001010010000001110000011001101110000001010101001001111010100010110110010001000011001010000101010011111011000011000000110101111100110100101101101110110010100100011110011100001101000010011011101000000010...

output:

No

result:

ok single line: 'No'

Test #7:

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

input:

1000000 3
00000011100011100000000000000000111000000000000111001110000001110000000001110000001110000000000000000111000000000111011100000000000000000000011101111110000001110000000000000011100000000011100000000000000000000000000011100000000000111100011100000100000000111000111000000000000100000011100000...

output:

Yes

result:

ok single line: 'Yes'

Test #8:

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

input:

1000000 4
10000110000000010000110000111111111000010000111100001111111111111111111100001111111000011111111111111110000111000011111110000111111111111111111100001111111111110000111111111111111111000011111111111100001111111100000000111111111111111111111111100001110110000111111111111111111100001111100001...

output:

Yes

result:

ok single line: 'Yes'

Test #9:

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

input:

1000000 10
0000100000001111111111000000111111111100000001000001000000011111111110011111111110000000000000000011111111110000010000000000111111111011111111110000000011111111110000001111100000000001111100000001111111111000001111111111001111111111001111111111000001111111110000000000100000000000000000001...

output:

Yes

result:

ok single line: 'Yes'

Test #10:

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

input:

1000000 20
1000000000000000000001111111111100000000000000000000011111111110100000000000000000000111000000000000000000001111111100000000000000001111111111111111111100001111111111111111111111111111111111111011111111111111011111111111111111111111100000000111111111111111111110000000000001111110000000000...

output:

Yes

result:

ok single line: 'Yes'

Test #11:

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

input:

1000000 100
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #12:

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

input:

1000000 200
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #13:

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

input:

1000000 1000000
00101011010001000010010000111101010101101011111101110111110011011110001001011010011100101111011110011011010110000010110101100100111001110110101101010011111101010111011010110000110110110101100010011100101111001101110010011000111011011110111000010011010101000100101011110110011010111011...

output:

No

result:

ok single line: 'No'

Test #14:

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

input:

1000000 999999
010101111111011011110000110100111101111011000110101100001101110010110100101000111111111001011001001111101101110111010001110010101010101110001110000001010110010110111000110101001100000110111111110000010111011110110110110010100101100010010100110111101111001101110111101000101101111000111...

output:

No

result:

ok single line: 'No'

Test #15:

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

input:

1000000 3
00000011100011100000000000000000111000000000000111001110000001110000000001110000001110000000000000000111000000000111011100000000000000000000011101111110000001110000000000000011100000000011100000000000000000000000000011100000000000111100011100000100000000111000111000000000000100000011100000...

output:

No

result:

ok single line: 'No'

Test #16:

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

input:

1000000 4
10000110000000010000110000111111111000010000111100001111111111111111111100001111111000011111111111111110000111000011111110000111111111111111111100001111111111110000111111111111111111000011111111111100001111111100000000111111111111111111111111100001110110000111111111111111111100001111100001...

output:

No

result:

ok single line: 'No'

Test #17:

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

input:

1000000 10
0000100000001111111111000000111111111100000001000001000000011111111110011111111110000000000000000011111111110000010000000000111111111011111111110000000011111111110000001111100000000001111100000001111111111000001111111111001111111111001111111111000001111111110000000000100000000000000000001...

output:

No

result:

ok single line: 'No'

Test #18:

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

input:

1000000 20
1000000000000000000001111111111100000000000000000000011111111110100000000000000000000111000000000000000000001111111100000000000000001111111111111111111100001111111111111111111111111111111111111011111111111111011111111111111111111111100000000111111111111111111110000000000001111110000000000...

output:

No

result:

ok single line: 'No'

Test #19:

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

input:

1000000 100
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111...

output:

No

result:

ok single line: 'No'

Test #20:

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

input:

1000000 200
000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000001111111111111111111...

output:

No

result:

ok single line: 'No'

Test #21:

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

input:

1000000 1000000
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

Yes

result:

ok single line: 'Yes'

Test #22:

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

input:

1000000 999999
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

output:

No

result:

ok single line: 'No'

Extra Test:

score: 0
Extra Test Passed