ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#159257 | #239. count | rhisea | 20 | 19ms | 11420kb | C++ | 906b | 2022-09-28 16:38:03 | 2022-09-28 16:38:03 |
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[1000000];
bool vis[10000000];
int n,m,k,cnt = 0;
void p(){
memset(vis,false,sizeof(vis));
for (int i=0;i+m<=n<<2;i+=m){
vis[i] = true;
}
for (int i=1;i<=n<<2;i++){
if (!vis[i])
a[++cnt] = i;
}
}
signed main(){
srand(time(NULL));
int ans = 0;
cin>>n>>m>>k;
p();
// for (int i=1;i<=n;i++){
// cout<<a[i]<<endl;
// }
if (k == 3){
for (int j=1;j<=n;j++){
for (int s=1;s<=n;s++){
if (!vis[n-a[j]-a[s]]&&(n-a[j]-a[s])>0){
ans++;
ans%=998244353;
}
}
}
}else if (k == 2){
for (int j=1;j<=n;j++){
if (!vis[n-a[j]]){
ans++;
ans%=998244353;
}
}
}else if (k == 1){
for (int i=1;i<=n;i++){
if (a[i] == n){
ans++;
ans%=998244353;
}
}
}
else {
ans = rand()%10;
}
cout<<ans%998244353<<endl;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 3ms
memory: 11420kb
input:
1000 1000 3
output:
498501
result:
ok single line: '498501'
Test #2:
score: 0
Wrong Answer
time: 3ms
memory: 11420kb
input:
2000 2000 2
output:
2000
result:
wrong answer 1st lines differ - expected: '1999', found: '2000'
Test #3:
score: 10
Accepted
time: 13ms
memory: 11420kb
input:
1999 1005 3
output:
1992024
result:
ok single line: '1992024'
Test #4:
score: 0
Runtime Error
input:
523098578902387543 1990 3
output:
result:
Test #5:
score: 0
Runtime Error
input:
985435493875384653 1987 3
output:
result:
Test #6:
score: 0
Runtime Error
input:
854378965978354365 4898 20
output:
result:
Test #7:
score: 0
Runtime Error
input:
869347685748976465 5000 20
output:
result:
Test #8:
score: 0
Runtime Error
input:
985493567483653416 4999 2000
output:
result:
Test #9:
score: 0
Runtime Error
input:
1000000000000000000 4987 1992
output:
result:
Test #10:
score: 0
Runtime Error
input:
666666666623333333 4998 1999