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;
int main(){
int l, r;
cin >> l >> r;
int ans = 0, max = 0;
for(int i = 0; i < r; i++){
int n; cin >> n;
int x, sum = 0;
while(n--){
cin >> x;
sum += x;
}
if(max < sum) max = sum;
}
if(max % 2) max--;
ans = 2 * max - l;
if(ans < 0) ans = 0;
cout << ans << endl;
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... |