Submission #292255

#TimeUsernameProblemLanguageResultExecution timeMemory
292255amiratouHotter Colder (IOI10_hottercolder)C++14
52 / 100
4219 ms10872 KiB
#include "grader.h" #include <bits/stdc++.h> #define rando mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()) using namespace std; map<pair<int,int>,int> mymap; int HC(int N){ if(N==1)return 1; mymap.clear(); int l=1,r=N,a,b,last=-1; while((r-l)>2){ a=l+(r-l)/3,b=r-(r-l)/3; int med=(a+b)>>1; //cerr<<l<<" "<<r<<"\n"; //cerr<<a<<" "<<b<<"\n"; int A,B; if(mymap.count({a,b})) B=mymap[{a,b}]; else{ A=Guess(a),B=Guess(b),last=b; mymap[{a,b}]=B; } if(!B) return (a+b)/2; if(B==1)l=med+1; else r=med; } //cerr<<l<<" "<<r<<"\n"; int g,h; if(mymap.count({l,r})){ //cerr<<"1111\n"; h=mymap[{l,r}]; } else{ g=Guess(l),h=Guess(r); mymap[{l,r}]=h; } if(!h)return l+1; else if(h==1)return r; else return l; }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:20:7: warning: variable 'A' set but not used [-Wunused-but-set-variable]
   20 |   int A,B;
      |       ^
hottercolder.cpp:14:18: warning: variable 'last' set but not used [-Wunused-but-set-variable]
   14 |  int l=1,r=N,a,b,last=-1;
      |                  ^~~~
hottercolder.cpp:33:6: warning: variable 'g' set but not used [-Wunused-but-set-variable]
   33 |  int g,h;
      |      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...