제출 #1067762

#제출 시각아이디문제언어결과실행 시간메모리
1067762dwuyCommuter Pass (JOI18_commuter_pass)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; typedef pair<int, int> pii; const int MX = 200005; int n, m, S, T, U, V; vector<pii> G[MX]; int dS[MX]; int dT[MX]; int dU[MX]; int dV[MX]; int f1[MX]; int f2[MX]; void dijkstra(int X, int *d){ for(int i=0; i<=n; i++) d[i] = 1e18; d[X] = 0; priority_queue<pii> Q; Q.push({0, X}); while(Q.size()){ int du, u; tie(du, u) = Q.top(); Q.pop(); du = -du; if(du != d[u]) continue; for(pii edge: G[u]){ int v, c; tie(v, c) = edge; if(d[v] > du + c){ d[v] = du + c; Q.push({-d[v], v}); } } } } int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> n >> m; cin >> S >> T; cin >> U >> V; for(int i=1; i<=m; i++){ int u, v, c; cin >> u >> v >> c; G[u].push_back({v, c}); G[v].push_back({u, c}); } dijkstra(S, dS); dijkstra(T, dT); dijkstra(U, dU); dijkstra(V, dV); vector<int> vt(n); for(int i=0; i<n; i++) vt[i] = i + 1; sort(vt.begin(), vt.end(), [&](const int &a, const int &b) -> bool {return dS[a] > dS[b];}); memset(f1, 0x3f, sizeof f1); memset(f2, 0x3f, sizeof f2); f1[T] = dU[T]; f2[T] = dV[T]; int ans = 1e18; for(int u: vt) if(dS[u] + dT[u] == dS[T]){ f1[u] = dU[u];        f2[u] = dV[u]; for(pii edge: G[u]){ int v, c; tie(v, c) = edge;            if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]); } } ans = min({ans, f1[u] + dV[u], f2[u] + dU[u]}); } cout << ans; return 0; }

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

commuter_pass.cpp:71:2: error: extended character   is not valid in an identifier
   71 |         f2[u] = dV[u];
      |  ^
commuter_pass.cpp:71:5: error: extended character   is not valid in an identifier
   71 |         f2[u] = dV[u];
      |    ^
commuter_pass.cpp:71:8: error: extended character   is not valid in an identifier
   71 |         f2[u] = dV[u];
      |      ^
commuter_pass.cpp:71:11: error: extended character   is not valid in an identifier
   71 |         f2[u] = dV[u];
      |        ^
commuter_pass.cpp:75:2: error: extended character   is not valid in an identifier
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |  ^
commuter_pass.cpp:75:5: error: extended character   is not valid in an identifier
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |    ^
commuter_pass.cpp:75:8: error: extended character   is not valid in an identifier
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |      ^
commuter_pass.cpp:75:11: error: extended character   is not valid in an identifier
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |        ^
commuter_pass.cpp:75:14: error: extended character   is not valid in an identifier
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |          ^
commuter_pass.cpp:75:17: error: extended character   is not valid in an identifier
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |            ^
commuter_pass.cpp: In function 'int32_t main()':
commuter_pass.cpp:71:2: error: '\U000000a0' was not declared in this scope
   71 |         f2[u] = dV[u];
      |  ^
commuter_pass.cpp:75:4: error: expected ';' before '\U000000a0'
   75 |             if(dS[v] + dT[v] == dS[T] && dS[v] > dS[u]){f1[u] = min(f1[v], f1[u]);f2[u] = min(f2[v], f2[u]);
      |   ^~
      |   ;