답안 #573851

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
573851 2022-06-07T10:28:21 Z Sho10 Hotter Colder (IOI10_hottercolder) C++17
25 / 100
546 ms 8748 KB
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho
#include "grader.h"
using ll=long long;
using ld=long double;
int const INF=1000000005;
ll const LINF=1000000000000000005;
ll const mod=6700417;
ld const PI=3.14159265359;
ll const MAX_N=3e5+5;
ld const EPS=0.00000001;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(a) (int)a.size()
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int n,check=0,last=0;
ll solve(ll l,ll r){
ll mid=(l+r)/2;
if(l==r){
    return l;
}
if(last==-1){
    ll x=Guess(l);
    last=1;
}
if(last==1){
    ll x=Guess(r);
    last=2;
    if(x==1){
        return solve(mid+1,r);
    }else if(x==-1){
    last=-1;
    return solve(l,mid);
    }else if(x==0){
        last=-1;
    return solve(l,mid);
    }
}else if(last==2){
ll x=Guess(l);
last=1;
if(x==1){
    return solve(l,mid);
}else if(x==0){
return solve(l,mid);
}else if(x==-1){
last=-1;
return solve(mid+1,r);
}
}
}
int HC(int N){
if(N==1){
    return 1;
}
ll x=Guess(N-1);
ll y=Guess(N);
if(y==1){
    return N;
}
last=2;
return solve(1,N);
}

Compilation message

hottercolder.cpp: In function 'll solve(ll, ll)':
hottercolder.cpp:28:8: warning: unused variable 'x' [-Wunused-variable]
   28 |     ll x=Guess(l);
      |        ^
hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:60:4: warning: unused variable 'x' [-Wunused-variable]
   60 | ll x=Guess(N-1);
      |    ^
hottercolder.cpp: In function 'll solve(ll, ll)':
hottercolder.cpp:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 1236 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 1300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 1300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 546 ms 8748 KB Output isn't correct - alpha = 0.000000000000