# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
321499 | egas | Lasers (NOI19_lasers) | C++14 | 104 ms | 1516 KiB |
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];
}
long long sum=accumulate(a.begin(),a.end(),0LL);
long long cur=0;
for(long long j = 0 ; j < a.size() ; j++) {
long long meat=a[j];
long long dem=l-(sum-a[j]);
if(meat>=(dem/2)) {
long double temp = meat - (dem/2.0);
cur+=(long long)(temp/0.5);
}
}
res=max(res,cur);
}
cout << res << '\n';
return 0;
}
Compilation message (stderr)
# | 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... |