Submission #321497

#TimeUsernameProblemLanguageResultExecution timeMemory
321497egasLasers (NOI19_lasers)C++14
24 / 100
108 ms6124 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...