Submission #669127

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6691272022-12-05 19:43:47thiago_bastosCrayfish scrivener (IOI12_scrivener)C++17
100 / 100
425 ms157736 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 24 * 1e6, M = 1e6;
int nr = 1, roots[M+10], len[M+10], le[N], ri[N], cur;
char letter[N];
int build(int l, int r) {
int p = cur++;
if(l != r) {
int m = (l + r) / 2;
le[p] = build(l, m);
ri[p] = build(m + 1, r);
}
return p;
}
int upd(int k, char c, int l, int r, int p) {
int np = cur++;
le[np] = le[p], ri[np] = ri[p];
if(l == r) letter[np] = c;
else {
int m = (l + r) / 2;
if(k <= m) le[np] = upd(k, c, l, m, le[p]);
else ri[np] = upd(k, c, m + 1, r, ri[p]);
}
return np;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...