# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
573914 | Sho10 | Hotter Colder (IOI10_hottercolder) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "grader.h"
#include "hottercolder.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <iostream>
static int moves, TT, NN, prev = -1;
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;
//printf("%d %d",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,mx=0;
double worst = 999999;
for(int X=1;X<=500;X++){
for(int T=1;T<=X;T++){
NN=X;
TT=T;
// printf("%d %d ",X,T);
prev = -1;
moves = 0;
int h = HC(NN);
if (h != TT) {
// printf("DA");
printf("%d %d %d",NN,TT,h);
exit(91);
}
sub2=0;
sub3=0;
if ( NN <= 500 && moves > 500 ) exit(93);
if ( NN <= 500 && moves <=18 ) sub2=1;
if ( NN <= 500 && moves <=16 ) sub3=1;
OK++;
if(moves>mx){
mx=moves;
}
if(!sub3){
//printf("DA");
printf("%d",moves);
printf("%d %d",X,T);
exit(91);
}
}
}
printf("%d",moves);
}