제출 #261166

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2611662020-08-11 13:09:17Nightlight자동 인형 (IOI18_doll)C++14
100 / 100
142 ms16416 KiB
#include "doll.h"
#include <bits/stdc++.h>
#define LOG2(n) (31 - __builtin_clz(n))
#define pii pair<int, int>
using namespace std;
int N, M;
int A[400005];
int tmp[400005];
int order[400005];
int to[400005];
int id[400005];
int X[400005], Y[400005];
int tot;
int cnt = 2;
void gen_order(int l, int r) {
if(l == r) return;
int mid = ((l + r) >> 1) + 1;
for(int i = l; i <= r; i += 2) {
tmp[l + (i - l) / 2] = order[i];
tmp[mid + (i - l) / 2] = order[i + 1];
}
for(int i = l; i <= r; i++) order[i] = tmp[i];
gen_order(l, mid - 1), gen_order(mid, r);
}
int DFS(int l, int r) {
int sz = 0, now;
if(l + 1 == r) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...