# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
44540 | 2018-04-03T04:20:15 Z | zetapi | 관광 (NOI14_sightseeing) | C++14 | 3500 ms | 120860 KB |
/* Contest : Task : */ #include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define ll long long #define F first #define S second #define itr ::iterator typedef pair<int,int> pii; const int MAX=6e5+99; vector<pii> vec[MAX]; int V,E,Q,X,Y,Z,res[MAX]; void dijkstra() { int tem; pii cur; set<pii> pq; pq.insert(mp(MAX,1)); res[1]=MAX; while(! pq.empty()) { cur=*pq.begin(); pq.erase(pq.begin()); for(auto A:vec[cur.second]) { tem=min(cur.first,A.second); if(tem>res[A.first]) { if(res[A.first]) pq.erase(pq.find(mp(res[A.first],A.first))); res[A.first]=tem; pq.insert(mp(res[A.first],A.first)); } } } return ; } signed main() { //ios_base::sync_with_stdio(false); /*cin.tie(0); cout.tie(0);*/ //cin>>V>>E>>Q; cout<<(int)log2(500000)*(5000000+500000); scanf("%d %d %d",&V,&E,&Q); while(E--) { scanf("%d %d %d",&X,&Y,&Z); vec[X].pb(mp(Y,Z)); vec[Y].pb(mp(X,Z)); } dijkstra(); while(Q--) { scanf("%d",&X); printf("%d\n",res[X]); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3563 ms | 14328 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 36 ms | 29284 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 76 ms | 33560 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3561 ms | 120860 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |