Submission #1012404

# Submission time Handle Problem Language Result Execution time Memory
1012404 2024-07-02T06:13:48 Z huutuan Hotter Colder (IOI10_hottercolder) C++14
50 / 100
455 ms 8028 KB
#include "grader.h"

#include <bits/stdc++.h>

using namespace std;

mt19937 rng(69420);

int HC(int N){
   int l=1, r=N;
   while (l<=r){
      int mid=(l+r)>>1;
      if (l==r) return mid;
      if (r-l<10){
         while (l<=r){
            int mid=(l+r)>>1;
            if (l==r) return mid;
            Guess(l);
            int t=Guess(r);
            if (!t) return mid;
            if (t==1) l=mid+1;
            else r=mid;
         }
         break;
      }
      int m1=(l+r)>>1, m2=(l+r+1)>>1;
      if (m1==m2) --m1, ++m2;
      Guess(m1);
      int t=Guess(m2);
      if (!t) return mid;
      if (t==1){
         l=m2;
         int t=Guess(r);
         mid=(l+r)>>1;
         if (!t) return mid;
         if (t==1) l=mid+1;
         else r=mid;
      }else{
         r=m2;
         int t=-Guess(l);
         mid=(l+r)>>1;
         if (!t) return mid;
         if (t==1) l=mid+1;
         else r=mid;
      }
   }
   return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 17 ms 7000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 17 ms 6744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 6776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 455 ms 8028 KB Output isn't correct - alpha = 0.000000000000
2 Halted 0 ms 0 KB -