제출 #828760

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8287602023-08-17 15:22:26overwatch9Commuter Pass (JOI18_commuter_pass)C++17
100 / 100
473 ms27268 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <array>
using namespace std;
using ll = long long;
const int maxn = 1e5 + 1;
vector <pair <int, int>> adj[maxn];
int N, M, S, T, U, V;
vector <ll> distU, distV, dpU, dpV;
void dijkstra1(int st, vector <ll> &dist) {
priority_queue <pair <ll, int>> pq;
vector <bool> processed(N+1);
dist[st] = 0;
pq.push({0, st});
while (!pq.empty()) {
int x = pq.top().second;
ll d = -pq.top().first;
pq.pop();
if (processed[x]) {
continue;
}
processed[x] = true;
for (auto i : adj[x]) {
if (dist[x] + i.second < dist[i.first]) {
dist[i.first] = dist[x] + i.second;
pq.push({-dist[i.first], i.first});
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

commuter_pass.cpp: In function 'void dijkstra1(int, std::vector<long long int>&)':
commuter_pass.cpp:19:12: warning: unused variable 'd' [-Wunused-variable]
   19 |         ll d = -pq.top().first;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...