Submission #975896

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9758962024-05-06 02:33:35NipphitchCities (BOI16_cities)C++11
100 / 100
1944 ms54216 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair <ll,int>
#define f first
#define s second
const int N=1e5+5;
const int K=40;
const ll INF=LLONG_MAX/2;
int n,k,m;
ll dp[K][N];
vector <pii> adj[N];
priority_queue <pii,vector<pii>,greater<pii>> pq;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
fill_n(dp[0],K*N,INF);
cin >> n >> k >> m;
for(int i=0;i<k;i++){
int x;
cin >> x;
dp[(1<<i)][x]=0;
}
for(int i=0;i<m;i++){
int u,v,w;
cin >> u >> v >> w;
adj[u].push_back({v,w});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cities.cpp: In function 'int main()':
cities.cpp:43:18: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   43 |             auto [d_u,u]=pq.top();
      |                  ^
cities.cpp:45:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   45 |             for(auto [v,w]:adj[u]){
      |                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...