# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
226476 | thebes | Olympic Bus (JOI20_ho_t4) | C++14 | 364 ms | 162656 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;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
#define pb push_back
const int MN = 202, MM = 5e4+5;
int N, M, i, j, x, y, w[MM], c[MM], u[MM], vs[MN], ban[MM], par[MN]; ll ans, dis[MN], a[MM][MN], b[MM][MN], cost[MM];
vector<pii> adj[MN], rev[MN];
vi tree; pii ed[MM];
void dij(int src,bool dir){
memset(par,-1,sizeof(par));
memset(vs,0,sizeof(vs));
for(i=1;i<=N;i++)
dis[i]=1LL<<55;
dis[src]=0;
int cur=src; ll mn;
while(cur!=-1){
vs[cur]=1;
if(dir==1){
for(auto v : adj[cur]){
if(ban[v.second]) continue;
if(dis[cur]+w[v.second]<dis[v.first]){
dis[v.first]=dis[cur]+w[v.second];
par[v.first]=v.second;
}
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... |