Submission #525904

#TimeUsernameProblemLanguageResultExecution timeMemory
525904leakedThe Big Prize (IOI17_prize)C++14
20 / 100
67 ms1100 KiB
#include "prize.h" #include <bits/stdc++.h> #define f first #define s second #define vec vector #define pb push_back #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define m_p make_pair #define sz(x) (int)(x).size() #define pw(x) (1LL<<(x)) //#define pragma optimize("unroll-loops") using namespace std; const int N=2e5+1; typedef pair<int,int> pii; template <class T> bool umin(T &a,const T &b){return (a>b?a=b,1:0);} template <class T> bool umax(T &a,const T &b){return (a<b?a=b,1:0);} int find_best(int n) { int i=0; map<int,vec<int>> mp; mp[0]=ask(0); while(i<n){ vec<int>need=ask(i); if(need[0]==0 && need[1]==0) return i; int l=i+1,r=n; while(l!=r){ int tm=(l+r)>>1; mp[tm]=ask(tm); if(need==mp[tm]) l=tm+1; else r=tm; } // if(need[0]=) i=l; } return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...