# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
532596 | amunduzbaev | Olympic Bus (JOI20_ho_t4) | C++17 | 468 ms | 7296 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;
#define ar array
#define int long long
const int N = 205, M = 5e4 + 5;
vector<ar<int, 3>> edges[2][N];
int a[M], b[M], c[M], p[M];
int d[N], par[N];
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
int n, m; cin>>n>>m;
for(int i=0;i<m;i++){
cin>>a[i]>>b[i]>>c[i]>>p[i];
edges[0][a[i]].push_back({b[i], c[i], i});
edges[1][b[i]].push_back({a[i], c[i], i});
}
auto djk = [&](int t, int u){
priority_queue<ar<int, 2>, vector<ar<int, 2>>, greater<ar<int, 2>>> q;
q.push({0, u});
for(int i=1;i<=n;i++) d[i] = 2e9;
memset(par, -1, sizeof par);
d[u] = 0;
while(!q.empty()){
int u = q.top()[1], D = q.top()[0]; q.pop();
if(D > d[u]) continue;
# | 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... |