# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
927089 | socpite | 한자 끝말잇기 (JOI14_kanji) | C++14 | 129 ms | 14612 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 "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX/2;
const int maxn = 305;
namespace anna{
vector<pair<int, int>> g[maxn];
vector<long long> shortest_path(int N, int s, long long C[]){
vector<long long> d(N, INF);
vector<int> vis(N, 0);
d[s] = 0;
for(int i = 1; i <= N; i++){
long long best = INF;
int x = -1;
for(int j = 0; j < N; j++){
if(vis[j])continue;
if(d[j] < best){
best = d[j];
x = j;
}
}
if(x == -1)break;
vis[x] = 1;
for(auto v: g[x]) if(d[v.first] > C[v.second] + best)d[v.first] = C[v.second] + best;
}
return d;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |