| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 116058 | someone_aa | Hotter Colder (IOI10_hottercolder) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
