4201 | 2023-03-16 09:03:08 | 1478 | Utazási iroda | cpp17 | Compilation error |
#include <bits/stdc++.h>
#include <random>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define fast_cin() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
const int N_MAX = 1e5 + 1;
vector<vector<int>> a(N_MAX);
vector<bool> lattam(N_MAX);
int db = 0;
void melysegi(int node, deque<int> ans){
ans.push(node);
db++;
for(int i = 0; i < a[node].size(); i++){
if(!lattam[a[node][i]]){
melysegi(a[node][i], ans);
lattam[a[node][i]] = 1;
}
}
ans.pop_back();
}
int main()
{
//fast_cin();
ifstream cin("in.txt");
long long n, k;
cin>>n>>k;
for(int i=1; i<n; i++){
int x, y;
cin>>x>>y;
a[x].push_back(y);
a[y].push_back(x);
}
for(int i=1; i<=n; i++){
sort(a[i].begin(), a[i].end());
}
int node;
if(n%k == 0){
node = k/n;
k = n;
}
else{
node = k/n+1;
k = n%k;
}
deque<int> ans;
ans.push(node);
melysegi(node, ans);
return 0;
}
exit status 1
main.cpp: In function 'void melysegi(int, std::deque<int>)':
main.cpp:44:9: error: 'class std::deque<int>' has no member named 'push'
44 | ans.push(node);
| ^~~~
main.cpp: In function 'int main()':
main.cpp:80:9: error: 'class std::deque<int>' has no member named 'push'
80 | ans.push(node);
| ^~~~
Exited with error status 1