# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
548174 | CommandMaster | Restore Array (RMI19_restore) | C++17 | 453 ms | 1044 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;
#define ll int
#define vll vector<ll>
#define vvll vector<vll>
#define pll pair<ll,ll>
int main() {
ll n, m;
cin >> n >> m;
vector<pair<pair<ll, ll>, ll>> graph(n+1);
for (ll i = 0; i < n; i++) graph.push_back({{i, i+1}, 1}), graph.push_back({{i+1, i}, 0});
for (ll i = 0; i < m; i++) {
ll l, r, k, v;
cin >> l >> r >> k >> v;
k--;
if (v == 1) {
// cout << l << ' ' << r+1 << ' ' << -((r-l+1)-k) << endl;
graph.push_back({{r+1, l}, k-(r-l+1)});
} else {
// cout << r+1 << ' ' << l << ' ' << (r-l+1)-k-1 << endl;
graph.push_back({{l, r+1}, (r-l+1)-k-1});
}
}
vll dist(n+1, 1e9);
dist[0] = 0;
bool changed = true;
for (ll i = 0; i < n+2; i++) {
// for (ll j = 0; j < n+1; j++) cout << dist[j] << ' ';
// cout << endl;
# | 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... |