Submission #707610

#TimeUsernameProblemLanguageResultExecution timeMemory
707610Specialistas13Swimming competition (LMIO18_plaukimo_varzybos)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define FAST_IO cin.tie(nullptr); ios_base::sync_with_stdio(0) int main() { FAST_IO; int n, a, b, current=0, maxi=0, ans=1e7; cin>>n>>a>>b; vector<int> numbers; for (int i=0; i<n; i++){ int a; cin>>a; numbers.push_back(a); } sort(numbers.begin(), numbers.end()); cout<<max(numbers[a-1]-numbers[0], numbers[n-1]-numbers[a]); return 0; }

Compilation message (stderr)

plaukimo_varzybos.cpp: In function 'int main()':
plaukimo_varzybos.cpp:11:18: warning: unused variable 'current' [-Wunused-variable]
   11 |     int n, a, b, current=0, maxi=0, ans=1e7;
      |                  ^~~~~~~
plaukimo_varzybos.cpp:11:29: warning: unused variable 'maxi' [-Wunused-variable]
   11 |     int n, a, b, current=0, maxi=0, ans=1e7;
      |                             ^~~~
plaukimo_varzybos.cpp:11:37: warning: unused variable 'ans' [-Wunused-variable]
   11 |     int n, a, b, current=0, maxi=0, ans=1e7;
      |                                     ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...