# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331875 | valerikk | Restore Array (RMI19_restore) | C++17 | 403 ms | 876 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;
typedef long long ll;
const int E = 20020;
int from[E], to[E], cost[E], edges = 0;
int add_edge(int u, int v, int w) {
from[edges] = u;
to[edges] = v;
cost[edges] = w;
return edges++;
}
const int N = 5007;
const int INF = 10001000;
int n, dist[N];
bool ford_bellman() {
dist[0] = 0;
for (int i = 1; i <= n; ++i) {
dist[i] = INF;
}
for (int i = 0; i < n; ++i) {
bool found = false;
for (int e = 0; e < edges; ++e) {
if (dist[from[e]] != INF && dist[from[e]] + cost[e] < dist[to[e]]) {
# | 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... |