Submission #518578

#TimeUsernameProblemLanguageResultExecution timeMemory
518578aurimsSwimming competition (LMIO18_plaukimo_varzybos)C++14
10 / 100
376 ms4308 KiB
#include <algorithm> #include <iostream> using namespace std; 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; for(int i = 0; i < n; i++) { if(i % a == 0) mn = t[i]; else if(i % a == a-1) { ans = max(ans, t[i]-mn); } } 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...