제출 #707620

#제출 시각아이디문제언어결과실행 시간메모리
707620Specialistas13Swimming 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) const int MAXN=1e7; int dp[MAXN]; int main() { FAST_IO; int n, a, b, 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()); for (int i=1; i<n; i++){ if (i>=a-1 && i<=b-1){ dp[i]=max(dp[i-1], min(numbers[i]-numbers[0], numbers[n-1]-numbers[i])); } else { dp[i]=max(dp[i-1], numbers[i]-numbers[i-1]); } } cout<<dp[n-1]; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

plaukimo_varzybos.cpp: In function 'int main()':
plaukimo_varzybos.cpp:14:18: warning: unused variable 'ans' [-Wunused-variable]
   14 |     int n, a, b, 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...