# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
991179 | JuliaTatad | Restore Array (RMI19_restore) | C++17 | 485 ms | 1052 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 <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
const int INF = 1e9; int n; int m;
//vector<vector<int>> gr; vector<bool> used;
struct Edge {
int from; int to; int w;
Edge(int from, int to, int w) : from(from), to(to), w(w) {}
};
int main() {
cin >> n >> m;
// we will have n+1 vertices
vector<Edge> edges;
for (int i = 0; i < m; i++) {
int l; int r; int k; int v; cin >> l >> r >> k >> v; r++; l++;
if (v == 0) {
edges.push_back(Edge(l - 1, r, r + 1 - l - k));
}
else {
edges.push_back(Edge(r, l - 1, l + k - r - 2));
}
}
for (int i = 1; i <= n; i++){
# | 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... |