# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
545288 | 2022-04-04T07:34:18 Z | MilosMilutinovic | Snake Escaping (JOI18_snake_escaping) | C++14 | 2000 ms | 3048 KB |
#include <bits/stdc++.h> using namespace std; int n,q; char s[1<<20],op[20]; int main(){ scanf("%d%d",&n,&q); scanf("%s",s); while(q--){ scanf("%s",op); int ans=0; for(int i=0;i<(1<<n);i++){ int ok=1; for(int j=0;j<n;j++){ if(op[j]=='?')continue; int b=((i>>(n-j-1))&1); if(b!=(int)(op[j]-'0'))ok=0; } if(ok==1)ans+=(int)(s[i]-'0'); } printf("%d\n",ans); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 224 KB | Output is correct |
2 | Correct | 13 ms | 308 KB | Output is correct |
3 | Correct | 12 ms | 320 KB | Output is correct |
4 | Correct | 11 ms | 212 KB | Output is correct |
5 | Correct | 11 ms | 316 KB | Output is correct |
6 | Correct | 13 ms | 320 KB | Output is correct |
7 | Correct | 13 ms | 212 KB | Output is correct |
8 | Correct | 11 ms | 212 KB | Output is correct |
9 | Correct | 14 ms | 292 KB | Output is correct |
10 | Correct | 13 ms | 316 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 224 KB | Output is correct |
2 | Correct | 13 ms | 308 KB | Output is correct |
3 | Correct | 12 ms | 320 KB | Output is correct |
4 | Correct | 11 ms | 212 KB | Output is correct |
5 | Correct | 11 ms | 316 KB | Output is correct |
6 | Correct | 13 ms | 320 KB | Output is correct |
7 | Correct | 13 ms | 212 KB | Output is correct |
8 | Correct | 11 ms | 212 KB | Output is correct |
9 | Correct | 14 ms | 292 KB | Output is correct |
10 | Correct | 13 ms | 316 KB | Output is correct |
11 | Execution timed out | 2063 ms | 3048 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 224 KB | Output is correct |
2 | Correct | 13 ms | 308 KB | Output is correct |
3 | Correct | 12 ms | 320 KB | Output is correct |
4 | Correct | 11 ms | 212 KB | Output is correct |
5 | Correct | 11 ms | 316 KB | Output is correct |
6 | Correct | 13 ms | 320 KB | Output is correct |
7 | Correct | 13 ms | 212 KB | Output is correct |
8 | Correct | 11 ms | 212 KB | Output is correct |
9 | Correct | 14 ms | 292 KB | Output is correct |
10 | Correct | 13 ms | 316 KB | Output is correct |
11 | Execution timed out | 2063 ms | 3048 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 224 KB | Output is correct |
2 | Correct | 13 ms | 308 KB | Output is correct |
3 | Correct | 12 ms | 320 KB | Output is correct |
4 | Correct | 11 ms | 212 KB | Output is correct |
5 | Correct | 11 ms | 316 KB | Output is correct |
6 | Correct | 13 ms | 320 KB | Output is correct |
7 | Correct | 13 ms | 212 KB | Output is correct |
8 | Correct | 11 ms | 212 KB | Output is correct |
9 | Correct | 14 ms | 292 KB | Output is correct |
10 | Correct | 13 ms | 316 KB | Output is correct |
11 | Execution timed out | 2060 ms | 2568 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 224 KB | Output is correct |
2 | Correct | 13 ms | 308 KB | Output is correct |
3 | Correct | 12 ms | 320 KB | Output is correct |
4 | Correct | 11 ms | 212 KB | Output is correct |
5 | Correct | 11 ms | 316 KB | Output is correct |
6 | Correct | 13 ms | 320 KB | Output is correct |
7 | Correct | 13 ms | 212 KB | Output is correct |
8 | Correct | 11 ms | 212 KB | Output is correct |
9 | Correct | 14 ms | 292 KB | Output is correct |
10 | Correct | 13 ms | 316 KB | Output is correct |
11 | Execution timed out | 2063 ms | 3048 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |