Submission #116058

# Submission time Handle Problem Language Result Execution time Memory
116058 2019-06-10T09:56:03 Z someone_aa Hotter Colder (IOI10_hottercolder) C++17
Compilation error
0 ms 0 KB
#include "grader.h"
#include "hottercolder.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <iostream>

static int moves, prev = -1;
int TT, NN;
int Guess(int x){
   int r;
   if (prev == -1 || abs(x-TT) == abs(prev-TT)) r = 0;
   else if (abs(x-TT) > abs(prev-TT)) r = -1;
   else r = 1;
   prev = x;
   if (x < 1 || x > NN) {
    exit(92);
   }
   moves++;
   return r;
}

int main(){
   int n=0,i,t,OK=0,sub1=0,sub2=0,sub3=0;
   double worst = 999999;

   for(NN=1;NN<=400;NN++) {
        for(TT=1;TT<=NN;TT++) {
      if (NN > n) n = NN;
      prev = -1;
      moves = 0;

      int h = HC(NN);
      if (h != TT) {
        std::cout<<"Invalid Answer "<<NN<<" "<<TT<<"\n";
         exit(91);
      }
      int W = floor(0.00001+log(3*NN)/log(2));
      double alpha = 2 - (double)moves/W;
      if (alpha < worst) worst = alpha;
       // 1 means failure
      if ( NN <= 500 && moves > 500 ) exit(93);
      if ( NN <= 500 && moves > 18 ) sub2=1;
      if ( NN <= 500 && moves > 16 ) sub3=1;
      OK++;
        }
   }
   if (!sub1) printf("OK 1\n");
   if (!sub2) printf("OK 2\n");
   if (!sub3) printf("OK 3\n");
   if (worst > 0) printf("OK 4 alpha %0.2lf\n",worst);
   return 0;
}

Compilation message

hottercolder.cpp:2:10: fatal error: hottercolder.h: No such file or directory
 #include "hottercolder.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.