#include "grader.h"
#include <stdlib.h>
#include <chrono>
#define jizz ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define pb push_back
#define ET cout << "\n"
#define F first
#define S second
#define MP make_pair
#define ALL(v) v.begin(),v.end()
#define MEM(i,j) memset(i,j,sizeof i)
#define DB(a,s,e) {for(int i=s;i<e;++i) cout << a[i] << " ";ET;}
using namespace std;
typedef long long ll;
int HC(int N)
{
srand(chrono::system_clock::now().time_since_epoch().count());
int l=1,r=N,ls=-1;
while(l<r)
{
int m=l+r>>1,t;
if(ls!=l&&ls!=r)
if(rand()%2) Guess(l),ls=l;
else Guess(r),ls=r;
if(ls==l)
{
t=Guess(r),ls=r;
if(t==0)
{
l=r=m;
break;
}
else if(t==1) l=m+1;
else r=m;
}
else
{
t=Guess(l),ls=l;
if(t==0)
{
l=r=m;
break;
}
else if(t==1) r=m;
else l=m+1;
}
}
return l;
}
Compilation message
hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:22:10: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int m=l+r>>1,t;
~^~
hottercolder.cpp:23:5: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
if(ls!=l&&ls!=r)
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
256 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
260 ms |
1376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
260 ms |
1272 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2730 ms |
8224 KB |
Output isn't correct - alpha = 0.000000000000 |