제출 #1139150

#제출 시각아이디문제언어결과실행 시간메모리
1139150MuhammetPermutation Recovery (info1cup17_permutation)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" // #include "grader.h" // #include "grader.cpp" #define SZ(s) (int)s.size() using namespace std; vector <vector <int>> ve; vector <int> path; void dfs(int x, int y){ path.push_back(x); for(auto i : ve[x]){ if(i == y) continue; dfs(i,x); path.push_back(x); } } int findEgg (int n, vector < pair < int, int > > briges) { ve.resize(n+1); for(auto [i,j] : briges){ ve[i].push_back(j); ve[j].push_back(i); } dfs(1,0); int l = 0, r = SZ(path)-1; map <int,bool> vis; while(l < r){ int md = (l + r) / 2; vis.clear(); vector <int> qwe; for(int i = l; i <= md; i++){ if(vis.find(path[i]) == vis.end()) qwe.push_back(path[i]), vis[path[i]] = true; } if(query(qwe)) r = md; else l = md+1; } return path[l]; }

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

Main.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
Main.cpp:38:12: error: 'query' was not declared in this scope
   38 |         if(query(qwe)) r = md;
      |            ^~~~~