# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
645355 | Alex_tz307 | Restore Array (RMI19_restore) | C++17 | 117 ms | 1100 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;
const int kN = 5e3;
const int INF = 1e9;
int n, m, d[1 + kN], cnt[1 + kN];
vector<pair<int, int>> g[1 + kN];
bitset<1 + kN> inQ;
/// Sistem de inecuatii diferentiale peste sumele partiale pe prefix
/// Dupa ce rezolv sistemul pentru sumele partiale obtin simplu si elementele: a[i] = p[i] - p[i - 1]
bool BellmanFord(int s) {
for (int i = 0; i <= n; ++i) {
d[i] = INF;
}
d[s] = 0;
queue<int> q;
q.emplace(s);
inQ[s] = true;
cnt[s] = 1;
while (!q.empty()) {
int u = q.front();
q.pop();
inQ[u] = false;
for (const auto &it : g[u]) {
int v, w;
tie(v, w) = it;
if (d[v] > d[u] + w) {
# | 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... |