제출 #163521

#제출 시각아이디문제언어결과실행 시간메모리
163521AkashiGap (APIO16_gap)C++14
0 / 100
124 ms5856 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; i <= Max - L ; 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...