ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#159255 | #239. count | rhisea | 0 | 7ms | 81056kb | C++ | 899b | 2022-09-28 16:30:35 | 2022-09-28 16:30:36 |
answer
#include <bits/stdc++.h>
#define N 10001010
#define mod 998244353
#define int long long
using namespace std;
int a[100001000];
int vis[10001010];
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++;
ans%=mod;
}
}
}
}else if (k == 2){
for (int j=1;j<=n;j++){
if (!vis[n-a[j]]){
ans++;
ans%=mod;
}
}
}else if (k == 1){
for (int i=1;i<=n;i++){
if (a[i] == n){
ans++;
ans%=mod;
}
}
}
else {
ans = rand()%10;
}
cout<<ans<<endl;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Runtime Error
input:
1000 1000 3
output:
result:
Test #2:
score: 0
Wrong Answer
time: 7ms
memory: 81056kb
input:
2000 2000 2
output:
2000
result:
wrong answer 1st lines differ - expected: '1999', found: '2000'
Test #3:
score: 0
Runtime Error
input:
1999 1005 3
output:
result:
Test #4:
score: 0
Memory Limit Exceeded
input:
523098578902387543 1990 3
output:
result:
Test #5:
score: 0
Memory Limit Exceeded
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