Submission #321915

#TimeUsernameProblemLanguageResultExecution timeMemory
321915techiehere08Lasers (NOI19_lasers)C++14
21 / 100
1091 ms3256 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int l, r; cin >> l >> r; int ans = 0; vector < vector < int >> v(r); for(int i = 0; i < r; i++){ int n; cin >> n; while(n--){ int x; cin >> x; v[i].push_back(x); } } for(int i = 1; i <= l; i++){ bool ok = true; for(int j = 0; j < r; j++){ int sum1 = 0, sum2 = 0; bool f = true; for(int x : v[j]){ if(sum1 + x < i && f){ sum1 += x; } else{ f = false; sum2 += x; } } //cout << i << " " << j << " " << sum1 << " " << sum2 << endl; if(l - i < sum2){ ok = false; } if(!ok) { //cout << "break for " << i << " " << j << endl; break; } } if(ok) ans++; } cout << l - ans << endl; 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...