# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1074312 | beaconmc | Hotter Colder (IOI10_hottercolder) | C++14 | 493 ms | 24332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(lli = x; i>y; i--)
using namespace std;
ll n;
map<ll,ll> sus;
ll cnt = 0;
int guess(ll a){
if (a==0) return -1;
if (a==n+1) return -1;
cnt++;
return Guess(a);
}
int solve(int a, int b){
//cout << a << " " << b << endl;
if (a==b) return a;
ll mid = (a+b)/2;
ll midleft = (a+mid)/2;
ll midright = (b+mid+1)/2;
ll left = guess(midleft);
ll right = guess(midright);
if (right == 0 ){
return (midleft+midright)/2;
}
else if (right == -1){
if ((midleft+midright)%2==0)return solve(a, mid-1);
else return solve(a,mid);
}else{
return solve(mid+1, b);
}
}
int HC(int N){
sus.clear();
n = N;
cnt = 0;
ll ans = solve(1,N);
//cout << ans << " " << cnt << endl;
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |