제출 #396189

#제출 시각아이디문제언어결과실행 시간메모리
396189giorgikobGap (APIO16_gap)C++14
30 / 100
51 ms1184 KiB
#include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; //#include "game.h" #include "gap.h" ll answer = 0; long long findGap(int T, int N) { ll pirveli, bolo; ll l = -1, r = 1e18; r++; ll cnt = 0; int calls = 0; while(true){ ll new_l,new_r; cnt++; if(cnt > (N+1)/2){ if(l != r){ answer = max(answer,r-l); } break; } if(l+1 > r-1){ if(l == r) break; answer = max(answer,r-l); break; } //cout << l+1 << " " << r-1 << endl; MinMax(l+1,r-1,&new_l,&new_r); //cout << new_l << " " << new_r << endl; calls++; if(new_l == -1){ answer = max(answer,r-l); break; } else { if(cnt > 1)answer = max(answer, max(new_l-l,r-new_r)); l = new_l; r = new_r; } } assert(calls<=(N+1)/2); return answer; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:16:8: warning: unused variable 'pirveli' [-Wunused-variable]
   16 |     ll pirveli, bolo;
      |        ^~~~~~~
gap.cpp:16:17: warning: unused variable 'bolo' [-Wunused-variable]
   16 |     ll pirveli, bolo;
      |                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...