답안 #1074262

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1074262 2024-08-25T09:10:18 Z beaconmc Hotter Colder (IOI10_hottercolder) C++14
50 / 100
439 ms 16536 KB
#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;
int guess(ll a){

   if (a==0) return -1;
   if (a==n+1) return -1;
   return Guess(a);

}
int solve(int a, int b){
   //cout << a << " " << b << endl;

   if (a==b) return a;
   ll mid = (a+b)/2;
   ll midval = guess(mid);
   ll right = guess(mid+1);


   if (right == -1){
      return solve(a, mid);
   }else{
      return solve(mid+1, b);
   }
}


int HC(int N){
   n = N;
   ll ans = solve(1,N);
   return ans;
}

Compilation message

hottercolder.cpp: In function 'int solve(int, int)':
hottercolder.cpp:23:7: warning: unused variable 'midval' [-Wunused-variable]
   23 |    ll midval = guess(mid);
      |       ^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 1440 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 1440 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 1372 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 439 ms 16536 KB Output isn't correct - alpha = 0.000000000000
2 Halted 0 ms 0 KB -