제출 #459203

#제출 시각아이디문제언어결과실행 시간메모리
459203TeaTimeOlympic Bus (JOI20_ho_t4)C++17
컴파일 에러
0 ms0 KiB
//#pragma GCC optimize("O3") //#pragma GCC target("avx2") #include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> #include <set> #include <queue> #include <unordered_map> using namespace std; #define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); typedef long long ll; typedef long double ld; const ll SZ = 1e5 + 100, INF = 1e9 * 1e9 + 100; struct edge { ll fr, to, c, d; }; ll n, m; vector<vector<ll>> gr; vector<edge> edges; vector<edge> good_edges; bool used[SZ], used2[SZ]; ll dist[SZ], par[SZ], d[SZ][2]; void djikstra(int st) { for (int i = 0; i < n; i++) dist[i] = INF; dist[st] = 0; par[st] = -1; vector<ll> u(n); for (int i = 0; i < n; i++) { pair<ll, ll> bst = { INF, INF }; for (int j = 0; j < n; j++) { if (!u[j]) bst = min(bst, { dist[j], j }); } u[bst.second] = 1; if (par[bst.second] != -1) { good_edges.push_back(edges[par[bst.second]]); used[par[bst.second]] = 1; } for (auto to : gr[bst.second]) { if (used[to]) continue; if (dist[edges[to].to] > bst.first + edges[to].c) { dist[edges[to].to] = bst.first + edges[to].c; par[edges[to].to] = to; } } } } int main() { fastInp; cin >> n >> m; gr.resize(n); for (int i = 0; i < m; i++) { ll u, v, c, d; cin >> u >> v >> c >> d; gr[u].push_back(edges.size()); edges.push_back({ u, v, c, d }); } djikstra(0); for (int i = 0; i < n; i++) d[i][0] = dist[i]; djikstra(0); for (int i = 0; i < m; i++) { used2[i] = used[i]; used[i] = 0; } djikstra(n - 1); for (int i = 0; i < n; i++) d[i][1] = dist[i]; djikstra(n - 1); ll ans = d[n - 1][0] + d[0][1]; for (int i = 0; i < m; i++) { if (!(used2[i] || used[i])) { ll v = edges[i].to, u = edges[i].fr; ll k = d[n - 1][0] + ; k = min(k, ); ans = min(ans, k + edges[i].d); } else { } } cout << ans; return 0; }

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

ho_t4.cpp: In function 'int main()':
ho_t4.cpp:93:25: error: expected primary-expression before ';' token
   93 |    ll k = d[n - 1][0] + ;
      |                         ^
ho_t4.cpp:94:15: error: expected primary-expression before ')' token
   94 |    k = min(k, );
      |               ^
ho_t4.cpp:92:7: warning: unused variable 'v' [-Wunused-variable]
   92 |    ll v = edges[i].to, u = edges[i].fr;
      |       ^
ho_t4.cpp:92:24: warning: unused variable 'u' [-Wunused-variable]
   92 |    ll v = edges[i].to, u = edges[i].fr;
      |                        ^