Submission #163523

#TimeUsernameProblemLanguageResultExecution timeMemory
163523AkashiGap (APIO16_gap)C++14
0 / 100
129 ms5880 KiB
#include <bits/stdc++.h> #include "gap.h" using namespace std; const long long INF = 1e18; set <long long> s; long long findGap(int T, int N){ s.clear(); long long Min, Max; MinMax(1, INF, &Min, &Max); s.insert(Min); s.insert(Max); long long L = (Max - Min + 1) / N, x, y; for(long long i = Min + L - 1; i <= Max - L + 1 ; i = i + L){ MinMax(i, min(i + L - 1, Max), &x, &y); if(x != -1) s.insert(x); if(y != -1) s.insert(y); } long long Sol = 0; set <long long> :: iterator it = s.begin(); set <long long> :: iterator it2 = next(it); while(it2 != s.end()){ Sol = max(Sol, *it2 - *it); ++it2; ++it; } return Sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...