이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int nmax = 5*1e5+5;
int lenwall[nmax];
int main() {
int L,R,X;
int maxlen = 0;
cin >> L >> R;
for(int i=1; i<=R; i++) {
cin >> X;
for(int j=1; j<=X; j++) {
cin >> lenwall[j];
maxlen = max(maxlen, lenwall[j]);
}
}
int open = L-maxlen;
if(2*open>=L) {
cout << "0" << endl;
} else {
cout << L-(2*open) << 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... |