| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1310950 | hmms127 | 기지국 (IOI20_stations) | C++20 | 0 ms | 0 KiB |
//#include "stations.h"
#include <vector>
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
vector<int>labels(n);
for(int i=0;i<n;i++)labels[i]=i;
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
auto can=[&](int node,int par){
if(par==node)return 1;
while(par>=node){
par-=1;par/=2;
if(par==node)return 1;
}
return (par==node);
};
for(auto it:c){
if(can(it,t))return it;
}
return c[0];
}
