# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
219370 | ho94949 | 치료 계획 (JOI20_treatment) | C++17 | 318 ms | 196472 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 MAXM = 5000;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
int N, M;
int T[MAXM+2], L[MAXM+2], R[MAXM+2], C[MAXM+2];
long long cost[MAXM+2][MAXM+2];
long long dist[MAXM+2];
bool vis[MAXM+2];
long long dijk(int N, int s, int e)
{
memset(dist, 0x3f, sizeof dist);
memset(vis, 0, sizeof vis);
dist[s] = 0;
for(int _=0; _<N; _++)
{
int mini = -1; long long minv = INF;
for(int i=0; i<N; ++i)
if(!vis[i] && minv>dist[i])
mini = i, minv = dist[i];
if(mini == -1) return -1;
if(mini == e) return minv;
vis[mini] = true;
for(int i=0; i<N; ++i)
dist[i] = min(dist[i], dist[mini]+cost[mini][i]);
}
return -1;
}
int main()
{
Compilation message (stderr)
# | 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... |