# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331783 | 2020-11-30T05:19:15 Z | daniel920712 | Snake Escaping (JOI18_snake_escaping) | C++14 | 2000 ms | 2424 KB |
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <vector> #include <string.h> #include <map> #include <utility> #include <algorithm> #include <stack> using namespace std; char all[100005]; char tt[25]; int main() { int N,M,ans,i,j,ok; scanf("%d %d",&N,&M); scanf("%s",all); while(M--) { scanf("%s",tt); ans=0; for(i=0;i<(1<<N);i++) { ok=1; for(j=0;j<N;j++) { if((((1<<(N-j-1))&i)&&tt[j]=='0')||((((1<<(N-j-1))&i))==0&&tt[j]=='1')) ok=0; } if(ok) { //printf("%d\n",i); ans+=all[i]-'0'; } } printf("%d\n",ans); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 388 KB | Output is correct |
2 | Correct | 18 ms | 364 KB | Output is correct |
3 | Correct | 16 ms | 364 KB | Output is correct |
4 | Correct | 16 ms | 364 KB | Output is correct |
5 | Correct | 19 ms | 364 KB | Output is correct |
6 | Correct | 17 ms | 364 KB | Output is correct |
7 | Correct | 18 ms | 364 KB | Output is correct |
8 | Correct | 25 ms | 364 KB | Output is correct |
9 | Correct | 19 ms | 364 KB | Output is correct |
10 | Correct | 18 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 388 KB | Output is correct |
2 | Correct | 18 ms | 364 KB | Output is correct |
3 | Correct | 16 ms | 364 KB | Output is correct |
4 | Correct | 16 ms | 364 KB | Output is correct |
5 | Correct | 19 ms | 364 KB | Output is correct |
6 | Correct | 17 ms | 364 KB | Output is correct |
7 | Correct | 18 ms | 364 KB | Output is correct |
8 | Correct | 25 ms | 364 KB | Output is correct |
9 | Correct | 19 ms | 364 KB | Output is correct |
10 | Correct | 18 ms | 364 KB | Output is correct |
11 | Execution timed out | 2086 ms | 2424 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 388 KB | Output is correct |
2 | Correct | 18 ms | 364 KB | Output is correct |
3 | Correct | 16 ms | 364 KB | Output is correct |
4 | Correct | 16 ms | 364 KB | Output is correct |
5 | Correct | 19 ms | 364 KB | Output is correct |
6 | Correct | 17 ms | 364 KB | Output is correct |
7 | Correct | 18 ms | 364 KB | Output is correct |
8 | Correct | 25 ms | 364 KB | Output is correct |
9 | Correct | 19 ms | 364 KB | Output is correct |
10 | Correct | 18 ms | 364 KB | Output is correct |
11 | Execution timed out | 2086 ms | 2424 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 388 KB | Output is correct |
2 | Correct | 18 ms | 364 KB | Output is correct |
3 | Correct | 16 ms | 364 KB | Output is correct |
4 | Correct | 16 ms | 364 KB | Output is correct |
5 | Correct | 19 ms | 364 KB | Output is correct |
6 | Correct | 17 ms | 364 KB | Output is correct |
7 | Correct | 18 ms | 364 KB | Output is correct |
8 | Correct | 25 ms | 364 KB | Output is correct |
9 | Correct | 19 ms | 364 KB | Output is correct |
10 | Correct | 18 ms | 364 KB | Output is correct |
11 | Runtime error | 2 ms | 1388 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 388 KB | Output is correct |
2 | Correct | 18 ms | 364 KB | Output is correct |
3 | Correct | 16 ms | 364 KB | Output is correct |
4 | Correct | 16 ms | 364 KB | Output is correct |
5 | Correct | 19 ms | 364 KB | Output is correct |
6 | Correct | 17 ms | 364 KB | Output is correct |
7 | Correct | 18 ms | 364 KB | Output is correct |
8 | Correct | 25 ms | 364 KB | Output is correct |
9 | Correct | 19 ms | 364 KB | Output is correct |
10 | Correct | 18 ms | 364 KB | Output is correct |
11 | Execution timed out | 2086 ms | 2424 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |