제출 #370683

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3706832021-02-24 13:26:25TosakaUCWPoklon (COCI17_poklon7)C++17
96 / 120
1100 ms166164 KiB
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <iostream>
const int N = 1e6 + 5;
int n;
int L[N], R[N];
void convert(std::vector<char> &res, int x)
{
for (; x; x /= 2)
res.push_back(x % 2 ? '1' : '0');
std::reverse(res.begin(), res.end());
}
std::vector<char> dfs(int v)
{
std::vector<char> a, b;
if (L[v] < 0)
a = dfs(-L[v]);
else
convert(a, L[v]);
if (R[v] < 0)
b = dfs(-R[v]);
else
convert(b, R[v]);
if (a.size() < b.size())
swap(a, b);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...