# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
987469 | 2024-05-22T20:06:33 Z | activedeltorre | Semafor (COI20_semafor) | C++14 | 4000 ms | 348 KB |
#include <iostream> using namespace std; long long nr1[1500]; long long nr2[1500]; long long cif(long long val) { if(val==1) { return 1; } else if(val==2) { return 6; } else if(val==3) { return 21; } else if(val==4) { return 9; } else if(val==5) { return 28; } else if(val==6) { return 18; } else if(val==7) { return 5; } else if(val==8) { return 30; } else if(val==9) { return 29; } else return 3; } long long getid(long long val) { return cif(val/10)*0+cif(val%10); } long long mod=1e9+7; long long nmax=31; int main() { long long n,i,j,k,l,m,st,val,z; cin>>m>>n>>k>>st; val=getid(st); nr1[val]=1; for(i=1;i<=n;i++) { for(j=0;j<=nmax;j++) { for(z=0;z<=4;z++) { val=1<<z; nr2[j^val]+=nr1[j]; } } for(j=0;j<=nmax;j++) { nr1[j]=nr2[j]%mod; } if(i%k==0) { for(j=0;j<=9;j++) { nr1[getid(j)]*=2; } for(j=0;j<=nmax;j++) { nr1[j]-=nr2[j]; } } for(j=0;j<=nmax;j++) { nr2[j]=0; } } for(i=0;i<=9;i++) { cout<<nr1[getid(i)]%mod<<'\n'; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 344 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 1 ms | 344 KB | Output is correct |
10 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 344 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 1 ms | 344 KB | Output is correct |
10 | Correct | 1 ms | 348 KB | Output is correct |
11 | Correct | 3 ms | 348 KB | Output is correct |
12 | Execution timed out | 4065 ms | 348 KB | Time limit exceeded |
13 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |