# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
697654 | Jarif_Rahman | Snake Escaping (JOI18_snake_escaping) | C++17 | 408 ms | 26288 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
const int p3[] = {1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049, 177147, 531441, 1594323, 4782969, 14348907};
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int L, Q; cin >> L >> Q;
int* v = new int[1<<L];
for(int i = 0; i < (1<<L); i++){
char c; cin >> c;
v[i] = c-'0';
}
int* dp = new int[p3[L]];
fill(dp, dp+p3[L], 0);
for(int i = 0; i < (1<<L); i++){
int x = 0;
for(int j = 0; j < L; j++) if(i&(1<<j)) x+=p3[j];
dp[x]+=v[i];
}
for(int j = 0; j < L; j++) for(int i = 0; i < p3[L]; i++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |