제출 #213060

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2130602020-03-24 20:49:43DS007Commuter Pass (JOI18_commuter_pass)C++14
100 / 100
617 ms24308 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5;
int n, m, s, t, u, v;
vector<pair<int, int>> adj[N];
int du[N], dv[N], ds[N], dt[N];
void dijkstra(int src, int dist[]) {
fill(dist, dist + N, 1e18);
dist[src] = 0;
priority_queue<pair<int, int>, vector<pair<int, int>>, decltype(greater<>())> pq;
bool done[N] = {};
pq.push({0, src});
while (!pq.empty()) {
int temp = pq.top().second;
pq.pop();
if (done[temp])
continue;
done[temp] = true;
for (auto i : adj[temp]) {
if (dist[i.first] > dist[temp] + i.second) {
dist[i.first] = dist[temp] + i.second;
pq.push({dist[i.first], i.first});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...