제출 #729342

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7293422023-04-23 21:44:31finn__XOR (IZhO12_xor)C++17
100 / 100
216 ms58464 KiB
#include <bits/stdc++.h>
using namespace std;
constexpr size_t L = 30;
struct Trie
{
Trie *c[2];
unsigned subtree_min;
Trie() { c[0] = c[1] = 0, subtree_min = UINT_MAX; }
void insert(unsigned x, unsigned j, unsigned i = 0)
{
if (i == L)
{
subtree_min = min(subtree_min, j);
return;
}
bool z = x & (1 << (L - i - 1));
if (!c[z])
c[z] = new Trie();
c[z]->insert(x, j, i + 1);
subtree_min = min(c[0] ? c[0]->subtree_min : UINT_MAX,
c[1] ? c[1]->subtree_min : UINT_MAX);
}
unsigned get_earliest_ge(unsigned x, unsigned y, unsigned i = 0)
{
if (i == L)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...