Submission #423059

# Submission time Handle Problem Language Result Execution time Memory
423059 2021-06-10T16:50:02 Z chirathnirodha Hotter Colder (IOI10_hottercolder) C++17
0 / 100
10000 ms 262144 KB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;

int HC(int N){
   int l=1,r=N;
   if(N==1)return 1;
   while(true){
      if(l-r+1==2){
         Guess(l);
         int xx=Guess(r);
         if(r==1)return r;
         else return l;
      }
      int a=(l+r+3)/4;
      int b=(l+r)*3/4;
      Guess(a);
      int y=Guess(b);
      if(y==0)return (l+r)/2;
      else if(y==1)l=(l+r+1)/2;
      else r=(l+r)/2;
   }
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:11:14: warning: unused variable 'xx' [-Wunused-variable]
   11 |          int xx=Guess(r);
      |              ^~
# Verdict Execution time Memory Grader output
1 Incorrect 136 ms 45320 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 107 ms 45316 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 88 ms 45340 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 10019 ms 262144 KB Time limit exceeded