Submission #518564

#TimeUsernameProblemLanguageResultExecution timeMemory
518564aurimsSwimming competition (LMIO18_plaukimo_varzybos)C++14
0 / 100
1 ms332 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, a, b; cin >> n >> a >> b; int t[40]; for(int i = 0; i < n; i++) cin >> t[i]; sort(t, t+n); int ans = -1; // bruteforce // subt #1 states a == b int trck = 0; int mn = 1e6+1; int mx = -1; for(int i = 0; i < n; i++) { if(i % a == 0) mn = t[i]; if(i % a == a-1) mx = t[i]; ans = max(ans, mx-mn); } cout << ans; return 0; }

Compilation message (stderr)

plaukimo_varzybos.cpp: In function 'int main()':
plaukimo_varzybos.cpp:14:6: warning: unused variable 'trck' [-Wunused-variable]
   14 |  int trck = 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...