Submission #423085

# Submission time Handle Problem Language Result Execution time Memory
423085 2021-06-10T17:12:58 Z chirathnirodha Hotter Colder (IOI10_hottercolder) C++17
0 / 100
1947 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(l<=r){
      if(r-l+1==2){
         Guess(l);
         int xx=Guess(r);
         if(r==1)return r;
         else return l;
      }
      if(l==r)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-1)/2;
   }
   if(l==r)return l;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:11:14: warning: unused variable 'xx' [-Wunused-variable]
   11 |          int xx=Guess(r);
      |              ^~
hottercolder.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 92 ms 44280 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 92 ms 44296 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 44256 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 1947 ms 262144 KB Output isn't correct - alpha = 0.000000000000