ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#159245 | #239. count | rhisea | 10 | 4ms | 16820kb | C++ | 836b | 2022-09-28 16:18:19 | 2022-09-28 16:18:19 |
answer
#include <bits/stdc++.h>
#define N 1000101
#define int long long
using namespace std;
int a[1000000];
int vis[1000101];
int n,m,k,cnt = 0;
signed main(){
srand(time(NULL));
int ans = 0;
cin>>n>>m>>k;
memset(vis,0,sizeof(vis));
for (int i=m;i+m<=N;i+=m){
vis[i] = 1;
}
for (int i=1;i<=N;i++){
if (vis[i] == 0)
a[++cnt] = i;
}
// 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]] == 0 and (n-a[j]-a[s])>0){
ans++;
}
}
}
}else if (k == 2){
for (int j=1;j<=n;j++){
if (!vis[n-a[j]]){
ans++;
}
}
}else if (k == 1){
for (int i=1;i<=n;i++){
if (a[i] == n){
ans++;
}
}
}
else {
ans = rand()%10;
}
cout<<ans%998244353<<endl;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Runtime Error
input:
1000 1000 3
output:
result:
Test #2:
score: 10
Accepted
time: 0ms
memory: 16816kb
input:
2000 2000 2
output:
1999
result:
ok single line: '1999'
Test #3:
score: 0
Runtime Error
input:
1999 1005 3
output:
result:
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
Wrong Answer
time: 0ms
memory: 16820kb
input:
854378965978354365 4898 20
output:
0
result:
wrong answer 1st lines differ - expected: '72755158', found: '0'
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 16820kb
input:
869347685748976465 5000 20
output:
0
result:
wrong answer 1st lines differ - expected: '946187174', found: '0'
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 16816kb
input:
985493567483653416 4999 2000
output:
0
result:
wrong answer 1st lines differ - expected: '715344547', found: '0'
Test #9:
score: 0
Wrong Answer
time: 4ms
memory: 16816kb
input:
1000000000000000000 4987 1992
output:
0
result:
wrong answer 1st lines differ - expected: '142311097', found: '0'
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 16820kb
input:
666666666623333333 4998 1999
output:
0
result:
wrong answer 1st lines differ - expected: '7913341', found: '0'