Submission #365131

# Submission time Handle Problem Language Result Execution time Memory
365131 2021-02-10T23:11:26 Z MilosMilutinovic Hotter Colder (IOI10_hottercolder) C++14
0 / 100
808 ms 55276 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

int Guess(int G);

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 - 1;
    } else {
      bot = mid + 1;
    }
  }
  return bot - 1;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:11:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   11 |     int mid = bot + top >> 1;
      |               ~~~~^~~~~
hottercolder.cpp:12:9: warning: unused variable 'x' [-Wunused-variable]
   12 |     int x = Guess(bot), y = Guess(top);
      |         ^
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 7020 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 7020 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 7020 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 808 ms 55276 KB Output isn't correct - alpha = 0.000000000000