# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1167653 | spycoderyt | Olympic Bus (JOI20_ho_t4) | C++20 | 13 ms | 4680 KiB |
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int N = 305;
#define int long long
const int M = 60005;
vector<pair<int,int> > A[N],B[N]; // actual and transpose
pair<int,int> edges[M];
const int inf = 1e12;
// int st[N],en[N],str[N],enr[N];
int weight[M],d[M];
int dis[4][N]; // st en str enr
int tmp[N];
int opt[2][N];
void djik(int u,int k) {
priority_queue<pair<int,int> > pq; // -w, i
pq.push({0,u});
while(!pq.empty()) {
auto [w,i] = pq.top();pq.pop();
w*=-1;
if(w>dis[k][i])continue;
for(auto [nxt,ei] : (k <= 1 ? A[i] : B[i])) {
if(dis[k][nxt] > w + weight[ei]) {
dis[k][nxt] = w + weight[ei];
if(k<=1){
opt[k][nxt] = ei;
}
pq.push({-dis[k][nxt], nxt});
}
# | 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... |