// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
// #pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
using namespace std;
typedef long double ld;
typedef int lli;
typedef pair<lli,lli> ii;
typedef vector<lli> vi;
typedef vector<ii> vii;
#define deb(x) cout << #x": " << (x) << endl;
vector <vi> adj;
vi tk;
lli curVis = 0;
void dfs(lli u){
tk[u] = curVis++;
// cout << u << ' ';
for (auto & i : adj[u]){
if (tk[i] == -1) dfs(i);
}
}
vi label(lli n, lli k, vi u, vi v){
adj.resize(n + 5);
for (auto &i : adj) i.clear();
tk.resize(n);
for (auto &i : tk) i = -1ll;
curVis = 0;
fore(i,0,n){
tk[i] = i + 1;
}
return tk;
}
lli find_next_station(lli s, lli t, vi c){
lli ans;
if (s > t){
ans = lli(s / 2ll);
}
else{
bool y = false;
lli lst;
while (t > 0){
lst = t;
t/=2;
if (s == t) { y = true; break; }
}
if (y) ans = lst;
else ans = lli(s / 2ll);
}
return ans;
}
// int main(){ _
// // freopen("file.in","r",stdin);
// // freopen("file.out","w",stdout);
// vector<vi> vv;
// lli t; cin >> t;
// while (t--){
// lli n, k; cin >> n >> k;
// vi a(n-1); vi b(n-1);
// fore(i,0,n-1) cin >> a[i] >> b[i];
// vi v = label(n, k, a, b);
// for (auto & i : v) cout << i << ' '; cout << ENDL;
// vv.pb(v);
// }
// return 0;
// }
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
338 ms |
824 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
287 ms |
832 KB |
Output is correct |
2 |
Correct |
358 ms |
780 KB |
Output is correct |
3 |
Correct |
613 ms |
684 KB |
Output is correct |
4 |
Correct |
435 ms |
684 KB |
Output is correct |
5 |
Correct |
358 ms |
684 KB |
Output is correct |
6 |
Correct |
295 ms |
688 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
345 ms |
852 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
642 ms |
936 KB |
Output is correct |
2 |
Incorrect |
407 ms |
684 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
364 ms |
852 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |