# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
554496 | kevinxiehk | 자동 인형 (IOI18_doll) | C++17 | 309 ms | 31112 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "doll.h"
#include<bits/stdc++.h>
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
using namespace std;
int cnt = -1;
pair<int, int> lr[400005];
map<int, int> hv;
int need = 0;
int arr[400005];
vector<int> add;
int dfs(int lay, int tc, int lef) {
if(lay == need) {
add.pb(tc + 1);
return tc + 1;
}
int k = (1 << (need - lay - 1));
int thisid = cnt; cnt--;
// cerr << thisid << ' ' << lef << '\n';
if(lef > k) {
lr[-thisid].fi = dfs(lay + 1, tc, k);
lr[-thisid].se = dfs(lay + 1, tc + (1 << lay), lef - k);
}
else {
lr[-thisid] = mp(-1, dfs(lay + 1, tc + (1 << lay), lef));
}
return thisid;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |