Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2)A,B,C

感觉这场的题面都好长,看的脑壳子疼(英语不好,啊我挂了

http://codeforces.com/contest/1075

A. The King's Race

考虑对角线为分界


#include 
using namespace std;
int main() {
	long long n,x,y;
	cin>>n>>x>>y;
	if((x+y)<=n+1)cout<<"White";
	else cout<<"Black";
	return 0;
}

B. Taxi drivers and Lyft

每个0都会选择离他近的1,预处理一下每个0的前后最近的1的位置,然后跑一边就能算出每个0应该会归属哪个1了

#include
using namespace std;
typedef long long ll;
const int maxn=1e6+5;
ll n,m;
ll res[maxn];
struct T{
	ll pre;
	ll last;
}tt[maxn];
ll x[maxn];
ll type[maxn];
int main(){
	scanf("%lld%lld",&n,&m);
	for(int i=0;i=0;--i){//更新后继 
		if(type[i]==0){
			tt[i].last=la;
		}
		else{
			la=i;
		} 
	}
	
	for(int i=0;i

C. The Tower is Going Home

    单独写了一下https://blog.csdn.net/TDD_Master/article/details/83960783

 

后面的题交的人好少,立个flag,来补

 

 

你可能感兴趣的:(Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2)A,B,C)