Submission #1017855

# Submission time Handle Problem Language Result Execution time Memory
1017855 2024-07-09T10:46:52 Z socpite Hotter Colder (IOI10_hottercolder) C++14
52.7778 / 100
421 ms 24676 KB
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;

mt19937 rng(69420);

int HC(int N){
   int l = 1, r = N;
   int prv = (rng()&1 ? l : r);
   Guess(prv);
   while(l < r){
      int tmp = Guess(prv^l^r);
      if(tmp == 0)return (r+l)/2;
      if(prv == r)tmp*=-1;
      if(tmp == -1){
         r = (r+l-1)/2;
         if(prv == l)Guess(l);
         prv = l;
      }
      else {
         l = (r+l)/2 + 1;
         if(prv == r)Guess(r);
         prv = r;
      }
   }
   return l;
}
# Verdict Execution time Memory Grader output
1 Correct 22 ms 6784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 6748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 421 ms 24676 KB Output is partially correct - alpha = 0.111111111111