# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1018204 | mnbvcxz123 | Snake Escaping (JOI18_snake_escaping) | C++17 | 571 ms | 43492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
int main() {
using namespace std;
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int L, Q;
cin >> L >> Q;
string S;
cin >> S;
vector<int> A(1 << L), dp1(1 << L), dp2(1 << L);
for (int i = 0; i < (1 << L); i++)
A[i] = dp1[i] = dp2[i] = S[i] - '0';
for (int b = 0; b < L; b++) {
for (int m = 0; m < (1 << L); m++) {
if (m >> b & 1)
dp1[m] += dp1[m ^ (1 << b)];
else
dp2[m] += dp2[m ^ (1 << b)];
}
}
while (Q--) {
string S;
cin >> S;
# | 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... |