제출 #902481

#제출 시각아이디문제언어결과실행 시간메모리
902481ALTAKEXE경주 (Race) (IOI11_race)C++14
0 / 100
1 ms2392 KiB
#include "race.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define all(v) v.begin(), v.end() //#pragma GCC optimize("Ofast") //#pragma GCC target("avx2") vector<vector<pair<int, int>>> adj; int k; pair<multiset<pair<int, int>>, int> dfs(int a, int p){ multiset<pair<int, int>> cur; cur.insert({0, 0}); int res = INT_MAX; vector<vector<pair<int, int>>> ch; for (auto [b, c] : adj[a]) { if(b == p) continue; ch.push_back({}); auto [s, x] = dfs(b, a); res = min(res, x); for (auto &i : s) { ch.back().push_back({i.first + c, i.second + 1}); } } for (auto &&i : ch) for (auto &&j : i) cur.insert(j); for (auto &&i : ch) { for (auto &&j : i) cur.erase(cur.find(j)); for (auto &&j : i) { if(cur.lower_bound({k - j.first, 0}) == cur.end()) continue; pair<int, int> x = *cur.lower_bound({k - j.first, 0}); if(x.first == k - j.first){ res = min(res, x.second + j.second); } } for (auto &&j : i) cur.insert(j); } return {cur, res}; } int best_path(int N, int K, int H[][2], int L[]) { return -1; }

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

race.cpp: In function 'std::pair<std::multiset<std::pair<int, int> >, int> dfs(int, int)':
race.cpp:20:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   20 |     for (auto [b, c] : adj[a]) {
      |               ^
race.cpp:23:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   23 |         auto [s, x] = dfs(b, a);
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...