#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
#define ll long long
//#define int ll
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int ans(int a,int b,int pos){
if(b<a)return 0;
if(a==b)return a;
if(pos<=a){
int x=Guess(b+a-pos);
if(x==0)return (a+b)/2;
if(x==-1)return ans(a,(a+b-1)/2,b+a-pos);
return ans((a+b+1)/2,b,b+a-pos);
}
if(pos>=b){
int k=Guess(a-(pos-b));
if(k==0)return (a+b)/2;
if(k==1)return ans(a,(a+b-1)/2,a-(pos-b));
return ans((a+b+1)/2,b,a-(pos-b));
}
/*int k=Guess(a);
int x=Guess(b);
if(x==0)return (a+b)/2;
if(x==-1)return ans(a,(a+b-1)/2,b);
return ans((a+b+1)/2,b,b);*/
}
int HC(int N){
Guess(1);
return ans(1,N,1);
}
Compilation message
hottercolder.cpp: In function 'int ans(int, int, int)':
hottercolder.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
107 ms |
57336 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
115 ms |
57336 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
103 ms |
57340 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2088 ms |
262144 KB |
Output isn't correct - alpha = 0.000000000000 |