Submission #1261925

#TimeUsernameProblemLanguageResultExecution timeMemory
1261925new_accStations (IOI20_stations)C++20
Compilation error
0 ms0 KiB
#include "stations.h" #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef long double ld; #define pb push_back #define pii pair<int, int> #define pll pair<ll, ll> #define st first #define nd second #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> #define debug false const int MAXN = 1000 + 17; vector<int> graf[MAXN]; int lev[MAXN]; int cnt = 0; int nr[MAXN]; void DFS1 (int v, int o) { for (auto x : graf[v]) { if (x != o) { lev[x] = lev[v] + 1; DFS1(x, v); } } } void DFS2 (int v, int o) { if (lev[v] % 2 == 0) { nr[v] = cnt; cnt ++; } for (auto x : graf[v]) { if (x != o) { DFS2(x, v); } } if (lev[v] % 2 == 1) { nr[v] = cnt; cnt ++; } } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> labels(n); for (int i = 0; i < n; i ++) { graf[i].clear(); } for(int i=0;i<u.size();i++){ graf[u[i]].push_back(v[i]); graf[v[i]].push_bcak(u[i]); } cnt = 0; DFS1(0, 0); DFS2(0, 0); for (int i = 0; i < n; i ++) { labels[i] = nr[i]; } return labels; } int find_next_station(int v, int u, vector<int> c) { sort(c.begin(), c.end()); int r = int(c.size()); if (v > c.back()) { for (int i = 1; i < r - 1; i ++) { if (c[i] <= u && u < c[i + 1]) { return c[i]; } } if (c[r - 1] <= u && u < v) { return c[r - 1]; } return c[0]; } for (int i = 1; i < r - 1; i ++) { if (c[i - 1] < u && u <= c[i]) { return c[i]; } } if (v < u && u <= c[0]) { return c[0]; } return c[r - 1]; }

Compilation message (stderr)

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:60:18: error: 'class std::vector<int>' has no member named 'push_bcak'; did you mean 'push_back'?
   60 |       graf[v[i]].push_bcak(u[i]);
      |                  ^~~~~~~~~
      |                  push_back