# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
503491 | 2022-01-08T07:53:19 Z | jpark | Lasers (NOI19_lasers) | C++14 | 103 ms | 262148 KB |
#include<iostream> #include<vector> using namespace std; int main(){ int l,r; cin >> l >> r; bool bl[l]; vector<int> rows[r]; for(int i=0; i<l; i++) bl[i] = 0; for(int i = 0; i<r; i++){ int x; cin >> x; for(int j=0; j<x; j++){ int w; cin >> w; rows[i].push_back(w); } } int minb = (l+1)/2; int maxb = (l+1)/2; bool bpres = false; for(int i=0; i<r; i++){ if(2*rows[i][0]>l){ bpres = true; int bnum = 2*rows[i][0]-l; if(bnum%2==0){ int tminb = l/2; tminb -= bnum/2; tminb += 1; minb = min(minb,tminb); int tmaxb = l/2; tmaxb += bnum/2; maxb = max(maxb,tmaxb); } else{ int tminb = (l+1)/2; tminb -= bnum/2; minb = min(minb,tminb); int tmaxb = (l+1)/2; tmaxb += bnum/2; maxb = max(maxb,tmaxb); } } } if(bpres){ cout << maxb-minb+1; } else{ cout << 0; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 42 ms | 3340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 42 ms | 3340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 103 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |