Submission #615794

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6157942022-07-31 12:41:34IvanJThe Big Prize (IOI17_prize)C++17
20 / 100
11 ms9836 KiB
#include<bits/stdc++.h>
#include "prize.h"
#define pb push_back
#define x first
#define y second
using namespace std;
typedef pair<int, int> ii;
const int maxn = 2e5 + 5;
vector<int> A[maxn];
vector<int> V;
int F = -1;
void check(int x) {
if(A[x][0] + A[x][1] == 0) F = x;
}
void find(int L, int R) {
int lo = L, hi = R - 1;
while(lo <= hi) {
int mid = (lo + hi) / 2;
if(A[mid].size() == 0) A[mid] = ask(mid);
check(mid);
if(F != -1) return;
if(A[mid][0] + A[mid][1] < A[hi + 1][0] + A[hi + 1][1]) {V.pb(mid);return;}
if(A[mid][1] == A[hi + 1][1]) hi = mid - 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...