# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1087592 | shiori_chan | Commuter Pass (JOI18_commuter_pass) | C++17 | 2075 ms | 262144 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<iostream>
#include<vector>
#include<queue>
#include<cstring>
#define int long long
using namespace std;
const int nd = 1e5 + 5 , INF = 1e18;
vector<pair<int,int> > adj[nd];
vector<int> dis[4] , g[nd] , in(nd , 0) , topo , f(nd , INF) , par[nd];
priority_queue< pair<int , int> , vector< pair<int,int> > , greater< pair<int,int> > >q;
bool vs[nd];
void dijs(int r , int p){
q.push({0 , r});
dis[p][r] = 0;
memset(vs , false , nd);
while(!q.empty()){
int u = q.top().second , h = q.top().first;
q.pop();
if(vs[u])continue;
//cout << r << " " << h << " " << u <<" " << '\n';
vs[u] = true;
for(auto v : adj[u])if(!vs[v.first]){
//cout << v.first << '\n';
if(h + v.second < dis[p][v.first]){
dis[p][v.first] = h + v.second , q.push({dis[p][v.first] , v.first});
}
}
}
}
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... |