# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
333323 | keko37 | Restore Array (RMI19_restore) | C++14 | 346 ms | 748 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long llint;
typedef pair <int, int> pi;
const int MAXN = 5005;
const int MAXM = 10005;
int n, m;
int from[MAXM], to[MAXM], w[MAXM];
int dist[MAXN];
bool relax () {
bool ok = 0;
for (int i = 0; i < m; i++) {
if (dist[to[i]] > dist[from[i]] + w[i]) {
dist[to[i]] = dist[from[i]] + w[i];
ok = 1;
}
}
for (int i = 1; i <= n; i++) {
if (dist[i] < dist[i - 1]) {
dist[i - 1] = dist[i];
ok = 1;
}
if (dist[i] > dist[i - 1] + 1) {
dist[i] = dist[i - 1] + 1;
ok = 1;
# | 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... |