F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_23318436_11387.cpp:1:1507: fatal error: GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stdc++.h>usin: Invalid argument
 #include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int, ll> P;const int MAXN = 1e5 + 10;const ll INF = 1e18 + 9;int n, m;struct node {int to, cost;node() {}node(int to, int cost) : to(to), cost(cost) {}};vector<node> G[MAXN];ll d[MAXN];ll dijkstra() {fill(d, d + MAXN, INF);priority_queue<P, vector<P>, greater<P> > q;d[0] = 0;q.push(P(0, 0));while(!q.empty()) {P u = q.top(); q.pop();if(d[u.second] < u.first) continue;for(int i = 0; i < G[u.second].size(); i++) {node nd = G[u.second][i];if(d[nd.to] > d[u.second] + nd.cost) {d[nd.to] = d[u.second] + nd.cost;q.push(P(d[nd.to], nd.to));}}}return d[n + 1];}int se[MAXN];int main() {int T, kase = 1;scanf("%d", &T);while(T--) {for(int i = 0; i <= n; i++) G[i].clear();scanf("%d%d", &n, &m);for(int i = 0; i < m; i++) {int u, v, c;scanf("%d%d%d", &u, &v, &c);G[u].push_back(node(v, c));}int k;scanf("%d", &k);for(int i = 0; i < k; i++) {scanf("%d", &se[i]);}ll ans = INF;for(int i = 0; i < 18; i++) {G[0].clear();for(int j = 0; j < k; j++) {if((se[j] >> i) & 1) {G[0].push_back(node(se[j], 0));} else {G[se[j]].push_back(node(n + 1, 0));}}ans = min(ans, dijkstra());for(int j = 0; j < k; j++) {if(!((se[j] >> i) & 1)) {G[se[j]].pop_back();}}G[0].clear();for(int j = 0; j < k; j++) {if((se[j] >> i) & 1) {G[se[j]].push_back(node(n + 1, 0));} else {G[0].push_back(node(se[j], 0));}}ans = min(ans, dijkstra());for(int j = 0; j < k; j++) {if((se[j] >> i) & 1) {G[se[j]].pop_back();}}}printf("Case #%d: %lld\n", kase++, ans);}return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
compilation terminated.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-02-17 06:00:23, Gzip enabled