# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1042613 | jmuzhen | Pinball (JOI14_pinball) | C++14 | 0 ms | 0 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;
struct Device {
int l, r;
int tp; // square that ball is tp'd to
int c; // cost to put device
};
struct Len {
int l, r;
int sz() const {
return r - l + 1;
}
};
Len union(Len a, Len b) {
Len x, y;
if (a.l < b.l) {
x = a; y = b;
}
else {
x = b; y = a;
}
// x.l <= y.l
return {y.l, x.r}; // note how if y.l > x.r then the Len is not valid
}
bool is_valid(Len x) {
return x.l <= x.r;
}
int main() {
int m, rows, cols; // m+2 rows, n columns, m devices, 1-indexed
cin >> m >> cols; rows = m + 2;
// vector<int> g(m+2+1, vector<int>(n+1)); // for demo
for (int i = 0; i < m; i++) {
int l, r, tp, c; cin >> l >> r >> tp >> c;
Device d = {l, r, tp, c};
}
int l = 1, r = cols;
}