# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
287836 | MatheusLealV | Snake Escaping (JOI18_snake_escaping) | C++17 | 314 ms | 24440 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using namespace std;
typedef pair<int, int> pii;
#define N 350010
int n, q;
string t;
int ans[1600000], pow3[30], cost[1600000];
int get_mask(int mask, int i){
return (mask/pow3[i]) % 3;
}
bool vis[N];
void gen(int mask){
if(vis[mask]) return;
vis[mask] = 1;
for(int i = 0; i < n; i++){
int value = get_mask(mask, i);
if(value == 2){
int L = mask, R = mask;
L += -2*pow3[i] + pow3[i];
R += -2*pow3[i];
gen(L);
gen(R);
# | 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... |