# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
496284 | 2021-12-21T04:53:38 Z | Ziel | Meteors (POI11_met) | C++17 | 6000 ms | 65540 KB |
/** * LES GREATEABLES BRO TEAM **/ #include <bits/stdc++.h> using namespace std; using ll = long long; #define sz(x) (int)x.size() const bool FLAG = false; void setIO(const string &f = ""); #define int ll void solve() { int n, m; cin >> n >> m; vector<int> o(m + 1); for (int i = 1; i <= m; i++) cin >> o[i]; vector<int> p(n + 1); for (int i = 1; i <= n; i++) cin >> p[i]; int q; cin >> q; vector<int> ans(n + 1, 1000000000); set<int> s[n + 1]; for (int rep = 1; rep <= q; rep++) { int l, r, x; cin >> l >> r >> x; if (l > r) { for (int i = l; i <= m; i++) { p[o[i]] -= x; s[o[i]].insert(rep); } for (int i = 1; i <= r; i++) { p[o[i]] -= x; s[o[i]].insert(rep); } } else { for (int i = l; i <= r; i++) { p[o[i]] -= x; s[o[i]].insert(rep); } } for (int i = 1; i <= n; i++) { if (p[i] <= 0) ans[i] = min(ans[i], sz(s[i])); } } for (int i = 1; i <= n; i++) { if (ans[i] == 1000000000) cout << "NIE\n"; else cout << ans[i] << '\n'; } } signed main() { setIO(); int tt = 1; if (FLAG) { cin >> tt; } while (tt--) { solve(); } return 0; } void setIO(const string &f) { ios_base::sync_with_stdio(false); cin.tie(nullptr); if (fopen((f + ".in").c_str(), "r")) { freopen((f + ".in").c_str(), "r", stdin); freopen((f + ".out").c_str(), "w", stdout); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 23 ms | 2276 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 56 ms | 6436 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 6043 ms | 17188 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 372 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1186 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 6073 ms | 50844 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 713 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 813 ms | 65540 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |