Submission #29120

#TimeUsernameProblemLanguageResultExecution timeMemory
29120osmanorhanCrocodile's Underground City (IOI11_crocodile)C++14
100 / 100
793 ms176712 KiB
#include "crocodile.h" #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <cmath> #include <list> #include <climits> #include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <cassert> #include <vector> #define all(x) x.begin() , x.end() #define fi first #define se second #define pb push_back #define umax( x , y ) x = max( x , (y) ) #define umin( x , y ) x = min( x , (y) ) #define For( i , a ) for(int i=1;i<=a;i++) #define ort (b+s)/2 #define y2 asrwjaelkf #define y1 asseopirwjaelkf using namespace std; const int maxn = 150020; const int kokn = 390; const int MOd = 1e9+7; typedef long long Lint; typedef long double db; typedef pair<int,int> ii; typedef pair<int,ii> iii; int a, b; vector<ii> w[maxn]; vector<int> v[maxn]; int used[maxn]; int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]) { a = N; b = M; for(int i=0;i<b;i++) { int j = R[i][0]; int k = R[i][1]; w[j].pb( ii( k, L[i] ) ); w[k].pb( ii( j, L[i] ) ); } priority_queue<ii> q; for(int i=0;i<K;i++) { q.push( ii( 0, P[i] ) ); used[P[i]] = 1; } while( !q.empty() ) { int t = q.top().se; int mal = -q.top().fi; q.pop(); used[t]++; if( used[t] == 1 || used[t] > 2 ) continue; if( t == 0 ) { return mal; } for(int i=0;i<w[t].size();i++) q.push( ii( -(mal+w[t][i].se), w[t][i].fi ) ); } assert(0); return -1; }

Compilation message (stderr)

crocodile.cpp: In function 'int travel_plan(int, int, int (*)[2], int*, int, int*)':
crocodile.cpp:69:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0;i<w[t].size();i++)
                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...