Submission #721411

#TimeUsernameProblemLanguageResultExecution timeMemory
721411FatihSolakGap (APIO16_gap)C++17
70 / 100
48 ms1088 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; const long long INF = 1e18; long long findGap(int t, int n) { long long x,y; MinMax(0,INF,&x,&y); long long ans = (y-x)/(n-1); long long num = x; long long last = x; while(num != y){ long long tmp1,tmp2; MinMax(num+1,num+ans,&tmp1,&tmp2); if(tmp1 == -1){ num += ans; } else{ ans = max(ans,tmp1 - last); num = tmp2; last = tmp2; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...