Lyft Level 5 Challenge 2018 - Elimination Round翻车记
打猝死场感觉非常作死。
A:判一下起点和终点是否在其两侧即可。
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int read()
{
int x=,f=;char c=getchar();
while (c<''||c>'') {if (c=='-') f=-;c=getchar();}
while (c>=''&&c<='') x=(x<<)+(x<<)+(c^),c=getchar();
return x*f;
}
#define N
int n,ax,ay,bx,by,cx,cy;
int main()
{
n=read(),ax=read(),ay=read(),bx=read(),by=read(),cx=read(),cy=read();
if (bx<ax&&cx>ax||bx>ax&&cx<ax||by<ay&&cy>ay||by>ay&&cy<ay) cout<<"NO";
else cout<<"YES";
return ;
}
B:由平方差公式,当且仅当a-b=1且a+b为质数时a2-b2是质数。
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int read()
{
int x=,f=;char c=getchar();
while (c<''||c>'') {if (c=='-') f=-;c=getchar();}
while (c>=''&&c<='') x=(x<<)+(x<<)+(c^),c=getchar();
return x*f;
}
#define ll long long
int T;
ll n,m;
int main()
{
T=read();
while (T--)
{
cin>>n>>m;
ll a=n+m,b=n-m;
if (b>) {cout<<"NO\n";continue;}
bool flag=;
for (ll i=;i*i<=a;i++)
if (a%i==) {flag=;break;}
if (flag) cout<<"YES\n";
else cout<<"NO\n";
}
return ;
}
C:若后继状态都为必胜态则该状态为必败态,否则为必胜态。可以按数从大到小暴力更新,由调和级数复杂度是有保证的。
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int read()
{
int x=,f=;char c=getchar();
while (c<''||c>'') {if (c=='-') f=-;c=getchar();}
while (c>=''&&c<='') x=(x<<)+(x<<)+(c^),c=getchar();
return x*f;
}
#define N 100010
int n,a[N],id[N],flag[N];
int main()
{
n=read();
for (int i=;i<=n;i++) id[a[i]=read()]=i;
memset(flag,,sizeof(flag));
flag[id[n]]=;
for (int i=n-;i>=;i--)
{
int x=id[i];
for (int j=x-i;j>=;j-=i)
if (a[j]>i&&!flag[j]) {flag[x]=;break;}
if (flag[x]==-)
for (int j=x+i;j<=n;j+=i)
if (a[j]>i&&!flag[j]) {flag[x]=;break;}
if (flag[x]==-) flag[x]=;
}
for (int i=;i<=n;i++) if (flag[i]) printf("A");else printf("B");
return ;
}
D:因子个数在3~5之间仅有这几种情况:pq,p2,p3,p4。对于p的幂次情况可以直接开方计算,将所有所得质数保存下来。然后考虑pq,将这个数除掉其与之前出现的所有质数的gcd,剩下的就是新出现的质因子了。开始直接交了一发泼辣的肉不出意外的T掉了。然后可能因为太晚了脑子不清醒,以奇怪的方式开始码正解,前前后后交了五次最后还是fst掉了。
E、F、G:怎么可能会啊。
result:rank437 rating+7
Lyft Level 5 Challenge 2018 - Elimination Round翻车记的更多相关文章
- [Lyft Level 5 Challenge 2018 - Elimination Round][Codeforces 1033D. Divisors]
		
题目链接:1033D - Divisors 题目大意:给定\(n\)个数\(a_i\),每个数的约数个数为3到5个,求\(\prod_{i=1}^{n}a_i\)的约数个数.其中\(1 \leq n ...
 - Lyft Level 5 Challenge 2018 - Elimination Round
		
A. King Escape 签. #include <bits/stdc++.h> using namespace std; ], y[]; int f1(int X, int Y) { ...
 - Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2) (前三题题解)
		
这场比赛好毒瘤哇,看第四题好像是中国人出的,怕不是dllxl出的. 第四道什么鬼,互动题不说,花了四十五分钟看懂题目,都想砸电脑了.然后发现不会,互动题从来没做过. 不过这次新号上蓝名了(我才不告诉你 ...
 - Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2) B 1075B (思维)
		
B. Taxi drivers and Lyft time limit per test 1 second memory limit per test 256 megabytes input stan ...
 - Lyft Level 5 Challenge 2018 - Final Round Div. 1没翻车记
		
夜晚使人着迷.没有猝死非常感动. A:显然对于水平线段,只有横坐标的左端点为1的时候才可能对答案产生影响:对于竖直直线,如果要删一定是删去一段前缀.枚举竖直直线删到哪一条,记一下需要删几条水平线段就可 ...
 - Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2)---ABC
		
A---The King's Race http://codeforces.com/contest/1075/problem/A 题意: 一个人在\((1,1)\), 一个人在\((n,n)\), 现 ...
 - Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2)
		
A. The King's Race 签. #include <bits/stdc++.h> using namespace std; #define ll long long ll n, ...
 - Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2) C. The Tower is Going Home(思维+双指针)
		
https://codeforces.com/contest/1075/problem/C 题意 一个宽为1e9*1e9的矩阵中的左下角,放置一个车(车可以移动到同一行或同一列),放置一些墙,竖的占据 ...
 - Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2) A. The King's Race
		
http://codeforces.com/contest/1075/problem/A On a chessboard with a width of nn and a height of nn, ...
 
随机推荐
- Odoo中创建模块语句
			
使用odoo的odoo-bin命令创建模块,比较方便. 进入终端界面(windows中可以是cmd中,linux中可以是$命令提示符下),以下在Windows中为例: python odoo-bin ...
 - 优步UBER司机全国各地奖励政策汇总 (4月18日-4月24日)
			
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
 - linux命令提示符设置
			
变成绿色 [root@localhost /usr/local]#vim /root/.bashrc # .bashrc # User specific aliases and functions a ...
 - windows中使用mysql配置my.ini时的坑
			
windows中安装mysql的一般步骤: mysql版本:5.7.16 1.解压 2.把解压的文件夹bin目录地址添加到环境变量PATH里面 3.在文件加中添加配置文件my.ini——配置内容后面说 ...
 - 解决xampp启动mysql失败
			
进入到注册表内 命令:regedit 进入到路径:计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL 修改路径为:" ...
 - Tensorflow、Pytorch、Keras的多GPU使用
			
Tensorflow.Pytorch.Keras的多GPU的并行操作 方法一 :使用深度学习工具提供的 API指定 1.1 Tesorflow tensroflow指定GPU的多卡并行的时候,也是可以 ...
 - Linux 深入理解inode/block/superblock
			
基础命令学习目录首页 原文链接:https://blog.csdn.net/Ohmyberry/article/details/80427492 档案系统特性 传统的磁盘与档案系统之应用中,一个分割槽 ...
 - 第三次ScrumMeeting博客
			
第三次ScrumMeeting博客 本次会议于10月27日(五)22时整在3公寓725房间召开,持续10分钟. 与会人员:刘畅.方科栋.窦鑫泽.张安澜. 1. 每个人的工作(有Issue的内容和链接) ...
 - oozie的shell-action中加入hive脚本命令启动执行shell同时操作hive,抛异常Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143
			
使用oozie来调度操作,用shell的action执行命令,其中shell里包含着hive -e 操作执行时,oozie窗口报 WARN ShellActionExecutor: - SERVER[ ...
 - python中取整的几种方法
			
#encoding:utf-8import math #向上取整print "math.ceil---"print "math.ceil(2.3) => " ...