제출 #1074247

#제출 시각아이디문제언어결과실행 시간메모리
1074247beaconmcHotter Colder (IOI10_hottercolder)C++14
0 / 100
2762 ms21720 KiB
#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){ if (a==b) return a; ll mid = (a+b)/2; ll midval = guess(mid); ll right = guess(mid+1); ll left = guess(mid-1); if (left == -1 && right==0 || left==-1 && right==-1){ return mid; } if (left == -1){ return solve(mid+1, b); }else{ return solve(a, mid); } } int HC(int N){ n = N; cout << "FUCK" << endl; ll ans = solve(1,N); cout << ans << endl; return ans; }

컴파일 시 표준 에러 (stderr) 메시지

hottercolder.cpp: In function 'int solve(int, int)':
hottercolder.cpp:27:19: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   27 |    if (left == -1 && right==0 || left==-1 && right==-1){
      |        ~~~~~~~~~~~^~~~~~~~~~~
hottercolder.cpp:22:7: warning: unused variable 'midval' [-Wunused-variable]
   22 |    ll midval = guess(mid);
      |       ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...