제출 #719982

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7199822023-04-07 07:48:51yellowtoadCommuter Pass (JOI18_commuter_pass)C++17
100 / 100
320 ms35392 KiB
#include <iostream>
#include <vector>
#include <queue>
#define f first
#define se second
#define int long long
#define pll pair<long long,long long>
using namespace std;
long long n, m, s, t, ss, tt, dist[100010], disu[100010], disv[100010], vis[100010], in[100010], minu[100010], minv[100010], minn[100010];
vector<pll> edge[100010];
vector<long long> dag[100010];
priority_queue<pll,vector<pll>,greater<pll>> pq;
void dijk(int st, long long (&dis)[100010]) {
pq.push({0,st});
for (int i = 1; i <= n; i++) dis[i] = 1e18, vis[i] = 0;
dis[st] = 0;
while (pq.size()) {
long long u = pq.top().se;
pq.pop();
if (vis[u]) continue;
vis[u] = 1;
for (int i = 0; i < edge[u].size(); i++) {
if (dis[edge[u][i].f] > dis[u]+edge[u][i].se) {
dis[edge[u][i].f] = dis[u]+edge[u][i].se;
pq.push({dis[edge[u][i].f],edge[u][i].f});
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

commuter_pass.cpp: In function 'void dijk(long long int, long long int (&)[100010])':
commuter_pass.cpp:24:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   for (int i = 0; i < edge[u].size(); i++) {
      |                   ~~^~~~~~~~~~~~~~~~
commuter_pass.cpp: In function 'void dfs(long long int)':
commuter_pass.cpp:37:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |  for (int i = 0; i < dag[u].size(); i++) {
      |                  ~~^~~~~~~~~~~~~~~
commuter_pass.cpp: In function 'int main()':
commuter_pass.cpp:61:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |   for (int j = 0; j < edge[i].size(); j++) {
      |                   ~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...