제출 #518576

#제출 시각아이디문제언어결과실행 시간메모리
518576aurimsSwimming competition (LMIO18_plaukimo_varzybos)C++14
10 / 100
365 ms11044 KiB
#include <algorithm> #include <iostream> using namespace std; typedef long long ll; int main() { int n, a, b; cin >> n >> a >> b; int t[1000000]; for(int i = 0; i < n; i++) cin >> t[i]; sort(t, t+n); int ans = -1; // bruteforce // subt #1 states a == b int mn = 1e6+1; int mx = -1; int track = 0; for(int i = 0; i < n; i++) { track++; if(track == 1) mn = t[i]; if(track == a) { mx = t[i]; ans = max(ans, mx-mn); track = 0; } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...