This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
long long l;
cin >> l;
long long r;
cin >> r;
long long res=0;
for(long long i = 0 ; i < r ; i++) {
long long x;
cin >> x;
vector<long long> a(x);
for(long long i = 0 ; i < x ; i++) {
cin >> a[i];
}
sort(a.begin(),a.end(),greater<long long>());
long long meat=a[0];
if(meat>=(l/2)) {
long double temp = meat - (l/2.0);
res=max(res,(long long)(temp/0.5));
}
}
cout << res << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |