Submission #365126

# Submission time Handle Problem Language Result Execution time Memory
365126 2021-02-10T23:06:05 Z MilosMilutinovic Hotter Colder (IOI10_hottercolder) C++14
0 / 100
10000 ms 24512 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

int HC(int n){
  int bot = 1, top = n;
  while (bot <= top) {
    int mid = bot + top >> 1;
    int x = Guess(bot), y = Guess(top);
    if (y == 0) {
      return mid;
    }
    if (y < 0) {
      top = mid;
    } else {
      bot = mid;
    }
  }
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:9:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    9 |     int mid = bot + top >> 1;
      |               ~~~~^~~~~
hottercolder.cpp:10:9: warning: unused variable 'x' [-Wunused-variable]
   10 |     int x = Guess(bot), y = Guess(top);
      |         ^
hottercolder.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
# Verdict Execution time Memory Grader output
1 Execution timed out 10081 ms 1260 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10033 ms 1260 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10086 ms 1260 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 10025 ms 24512 KB Time limit exceeded