QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#290751 | #4900. 数列重排 | zyz07 | 10 | 6ms | 6476kb | C++17 | 608b | 2023-12-25 12:37:10 | 2023-12-25 12:37:11 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define For(Ti,Ta,Tb) for(auto Ti=(Ta);Ti<=(Tb);++Ti)
#define Dec(Ti,Ta,Tb) for(auto Ti=(Ta);Ti>=(Tb);--Ti)
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define range(Tx) begin(Tx),end(Tx)
using ll=long long;
const int M=1e7+5,Mod=998244353;
int m,l,r,cnt;
char s[M];
ll sum(ll x){
x%=Mod;
return (x+1)*x/2%Mod;
}
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin>>m>>l>>r>>cnt>>(s+1);
ll n=m*cnt;
For(i,1,m){
n+=s[i]-'0';
}
ll ans=1;
For(i,1,m){
(ans*=233)%=Mod;
}
cout<<ans*sum(n-m+1)%Mod<<'\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3560kb
input:
2 0 2 2 01
output:
542890
result:
wrong answer 1st numbers differ - expected: '541257', found: '542890'
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: 3696kb
input:
2 0 1 114514 10
output:
218508755
result:
wrong answer 1st numbers differ - expected: '934764137', found: '218508755'
Subtask #5:
score: 10
Accepted
Test #17:
score: 10
Accepted
time: 6ms
memory: 4552kb
input:
1000000 1000000 1000000 928 01100010010000000101111110001111011101111000011110100101011110011001001000011000110101101100111110000100101010111001111100010011100110000000111110110100001100000000011101100001010001010000010000001001000110011111010101111100001001110110010100000011000010010001111010011100...
output:
437299311
result:
ok 1 number(s): "437299311"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
100 100 100 10000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
output:
119118463
result:
ok 1 number(s): "119118463"
Subtask #6:
score: 0
Wrong Answer
Test #19:
score: 0
Wrong Answer
time: 6ms
memory: 5968kb
input:
1000000 0 1000000 1 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
619753819
result:
wrong answer 1st numbers differ - expected: '852768823', found: '619753819'
Subtask #7:
score: 0
Wrong Answer
Test #21:
score: 0
Wrong Answer
time: 6ms
memory: 6476kb
input:
1000000 0 9823 627 01110001011101001100010011100101001011000011011110001101010000000101010111110111110010010001110100101001111000111100011101111001000000100111000010010100010101110110111110100010101010001110111001100011010001111000101010000110010010101110101010111110110001110111111000001110000110011...
output:
717380957
result:
wrong answer 1st numbers differ - expected: '383638431', found: '717380957'
Subtask #8:
score: 0
Skipped
Dependency #1:
0%
Subtask #9:
score: 0
Skipped
Dependency #1:
0%