제출 #1296021

#제출 시각아이디문제언어결과실행 시간메모리
1296021eri16기지국 (IOI20_stations)C++20
8 / 100
402 ms432 KiB
#include "stations.h" #include <bits/stdc++.h> using namespace std; vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector<int> lbl(n); for (int i=0; i<n; i++){ lbl[i]=i; } return lbl; } static inline bool is_descendant(int root, int node) { if (node==root) return true; while (node>root){ node=(node-1)/2; if (node==root) return true; } return false; } int find_next_station(int s, int t, vector <int> c){ if (c.size()==1){return c[0];} else if(s==0){ if (is_descendant(c[0], t)) return c[0]; return c[1]; } else{ if (is_descendant(c[1], t)) return c[1]; if (c.size()==3 && is_descendant(c[2], t)) return c[2]; return c[0]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...