Submission #68307

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
683072018-08-16 14:13:08hoangmaihuyDeda (COCI17_deda)C++14
140 / 140
669 ms17268 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5+1;
const int INF = 1e9+1;
int n, q;
int t[4*N];
void update(int i, int lo, int hi, int u, int val)
{
if (lo == hi)
{
if (!t[i] || t[i] > val) t[i] = val;
return;
}
int mid = (lo + hi) >> 1;
if (u <= mid) update(i*2, lo, mid, u, val);
else update(i*2+1, mid+1, hi, u, val);
if (t[i*2] && t[i*2+1]) t[i] = min(t[i*2], t[i*2+1]);
else if (!t[i*2]) t[i] = t[i*2+1];
else t[i] = t[i*2];
}
int findPos(int i, int lo, int hi, int start, int bound)
{
if (lo == hi)
{
if (t[i] && t[i] <= bound) return lo;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...