제출 #1186978

#제출 시각아이디문제언어결과실행 시간메모리
1186978hengliao기지국 (IOI20_stations)C++20
8 / 100
305 ms440 KiB
#include "stations.h"
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define vll vector<ll>
#define pll pair<ll, ll>
#define pb push_back

typedef int ll;

vector<int> label(int n, int k, vector<int> u, vector<int> v) {
	vll re(n);
	for(ll i=0;i<n;i++){
		re[i]=i+1;
	}
	return re;
}

int find_next_station(int s, int t, vector<int> c) {
	
	vll con;
	while(t>0){
		con.pb(t);
		t/=2;
	}
	sort(con.begin(), con.end());
	ll p=s/2;
	for(auto &it:c){
		if(it==p) continue;
		auto it2=lower_bound(con.begin(), con.end(), it);
		if(it2!=con.end() && (*it2)==it){
			return it;
		}
	}
	return p;
}
#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...