QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#68818 | #4900. 数列重排 | skin_to | 0 | 9ms | 8564kb | C++14 | 439b | 2022-12-21 09:19:07 | 2022-12-21 09:19:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int _=1e7+7,mod=998244353;
int m,l,r,X,n,pw[_],ans[_],res;
char s[_];
int main(){
scanf("%d%d%d%d",&m,&l,&r,&X);
scanf("%s",s);pw[0]=1;
for(int i=1;i<=m;i++)
pw[i]=1ll*pw[i-1]*233%mod;
int s0=X+s[0]-'0',s1=X+s[1]-'0',n=s0+s1;
ans[0]=(n+1)*n/2;ans[1]=ans[0]-s1;ans[2]=ans[0]-n;
for(int i=l;i<=r;i++)res=(res^(1ll*pw[i]*ans[i]%mod));
printf("%d\n",res);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 2ms
memory: 3688kb
input:
2 0 2 2 01
output:
541257
result:
ok 1 number(s): "541257"
Test #2:
score: -5
Wrong Answer
time: 2ms
memory: 3624kb
input:
4 1 4 2 00001
output:
327470
result:
wrong answer 1st numbers differ - expected: '525797597', found: '327470'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
2 0 1 114514 10
output:
926392820
result:
wrong answer 1st numbers differ - expected: '934764137', found: '926392820'
Subtask #5:
score: 0
Wrong Answer
Test #17:
score: 0
Wrong Answer
time: 8ms
memory: 8448kb
input:
1000000 1000000 1000000 928 01100010010000000101111110001111011101111000011110100101011110011001001000011000110101101100111110000100101010111001111100010011100110000000111110110100001100000000011101100001010001010000010000001001000110011111010101111100001001110110010100000011000010010001111010011100...
output:
0
result:
wrong answer 1st numbers differ - expected: '437299311', found: '0'
Subtask #6:
score: 0
Wrong Answer
Test #19:
score: 0
Wrong Answer
time: 9ms
memory: 8564kb
input:
1000000 0 1000000 1 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
54720
result:
wrong answer 1st numbers differ - expected: '852768823', found: '54720'
Subtask #7:
score: 0
Wrong Answer
Test #21:
score: 0
Wrong Answer
time: 8ms
memory: 8376kb
input:
1000000 0 9823 627 01110001011101001100010011100101001011000011011110001101010000000101010111110111110010010001110100101001111000111100011101111001000000100111000010010100010101110110111110100010101010001110111001100011010001111000101010000110010010101110101010111110110001110111111000001110000110011...
output:
631280063
result:
wrong answer 1st numbers differ - expected: '383638431', found: '631280063'
Subtask #8:
score: 0
Skipped
Dependency #1:
0%
Subtask #9:
score: 0
Skipped
Dependency #1:
0%