Submission #119573

# Submission time Handle Problem Language Result Execution time Memory
119573 2019-06-21T11:57:26 Z win11905 Hotter Colder (IOI10_hottercolder) C++11
25 / 100
10000 ms 8072 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std; 

int HC(int N){
   int l = 1, r = N;
   if(N == 1) 
      return N;
   if(N == 2) {
      Guess(1);
      int val = Guess(2);
      if(val == 1) return 2;
      else return 1;
   }
   if(N == 3) {
      Guess(1);
      int val = Guess(3);
      if(val == 1) return 3;
      if(val == 0) return 2;
      if(val == -1) return 1;
   }
   Guess(1);
   for(int i = 2; i <= N; ++i) {
      if(Guess(i) == -1) return i-1;
   }
   return N;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:6:8: warning: unused variable 'l' [-Wunused-variable]
    int l = 1, r = N;
        ^
hottercolder.cpp:6:15: warning: unused variable 'r' [-Wunused-variable]
    int l = 1, r = N;
               ^
# Verdict Execution time Memory Grader output
1 Correct 98 ms 1356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 94 ms 1400 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 94 ms 1272 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Execution timed out 10086 ms 8072 KB Time limit exceeded