제출 #709127

#제출 시각아이디문제언어결과실행 시간메모리
709127ono_de206Crocodile's Underground City (IOI11_crocodile)C++14
컴파일 에러
0 ms0 KiB
#include "crocodile.h" #include<bits/stdc++.h> using namespace std; #define pb push_back #define int long long const int inf = 1e18 + 10; const int mxn = 1e5 + 10; int a[mxn], is[mxn], n; vector<pair<int, int>> g[mxn]; map<int, int> mp; int solve(int x) { if(mp.find(x) != mp.end()) return mp[x]; if(is[x]) return 0; vector<int> tmp; int &ret = mp[x]; ret = inf; for(auto [y, t] : g[x]) { tmp.pb(solve(y) + t); } sort(tmp.begin(), tmp.end()); ret = tmp[1]; return ret; } int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]) { n = N; for(int i = 0; i < M; i++) { int x = R[i][0]; int y = R[i][1]; g[x].pb({y, L[i]}); g[y].pb({x, L[i]}); } for(int i = 0; i < K; i++) { is[P[i]] = 1; } return solve(0); }

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

crocodile.cpp: In function 'long long int solve(long long int)':
crocodile.cpp:21:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   21 |   for(auto [y, t] : g[x]) {
      |            ^
/usr/bin/ld: /tmp/ccHNuCrd.o: in function `main':
grader.cpp:(.text.startup+0x36): undefined reference to `travel_plan(int, int, int (*) [2], int*, int, int*)'
collect2: error: ld returned 1 exit status