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, ...
随机推荐
- Jmeter如何做接口测试
最近在学习Jmeter,记录下来,与大家分享. 1. 打开Jmeter,我用的是5.0版本,打开后如下图所示: 2. 右键测试计划,添加 - 线程(用户) - 线程组,如下如图所示: 3. 右键线程组 ...
- Python+selenium+pil+tesseract实现自动识别验证码
一.环境搭建准备: 1.Python下载,安装以及环境配置 2.IDE pycharm 工具下载,安装 3.ie浏览器 4.selenium 5.pil:pil第三方库的下载,win下安装whl文件, ...
- Phaser游戏框架与HTML Dom元素之间的通信交互
本想按照PHASER的HTML Dom元素官方实例:http://labs.phaser.io/index.html?dir=game%20objects/dom%20element/&q= ...
- vue cli 3 +jquery
const webpack = require('webpack')module.exports = { // baseUrl type:{string} default:'/' // 将部署应用程序 ...
- 001 -js对时间日期的排序
001-JS对时间日期的排序 最近在做公司的项目时间,产品给了一个很简单的页面,让帮忙写一下.首先看一下产品的需求: 需要对该列表进行排序 思路:(1)可以在数据库写sql语句的时间直接一个DESC按 ...
- 基于Mininet测量路径的损耗率
基于Mininet测量路径的损耗率 控制器采用POX,基于OVS仿真 Mininet脚本 创建Node mininet.node Node 创建链路连接 mininet.link TCLink 设置i ...
- python编辑三级目录
一.需求分析 三级目录要能够实现以下要求: 显示根目录,任何子目录中都可以通过输入b字符来返回根目录 任何子目录中都可以通过输入q字符来返回上一级目录 主目录进入子目录后,系统能够打印子目录,根据指打 ...
- .net mvc5 不同view()的视图 代码
public class Test { public int id { set; get; } public string name { set; get; } } public ActionResu ...
- I understand that you would like to know about the Amazon Giveaway
Dear Seller, Greetings from Amazon Seller Support. From your mail, I understand that you would like ...
- [Linux] Migrate plugins and setting for vim
Hot to migrate plugins and setting for vim from one computer to another ? Just copy ~/.vim and ~/.v ...