Codeforces Round #417 (Div. 2)-A. Sagheer and Crossroad
【题意概述】
在一个十字路口 ,给定红绿灯的情况, 按逆时针方向一次给出各个路口的左转,直行,右转,以及行人车道,判断汽车是否有可能撞到行人
【题目分析】
需要在逻辑上清晰,只需要把所有情况列出来即可
【AC】
#include<bits/stdc++.h>
using namespace std; int main() {
int light[][]; for(int i = ; i <= ; i++)
for(int j = ; j <= ; j++)
scanf("%d",&light[i][j]);
int ans = false;
if(light[][]) {
if(light[][] || light[][] || light[][] || light[][] || light[][] || light[][])
ans = true;
} if(light[][]) {
if(light[][] || light[][] || light[][] || light[][] || light[][] || light[][])
ans = true;
} if(light[][]) {
if(light[][] || light[][] || light[][] || light[][] || light[][] || light[][])
ans = true;
} if(light[][]) {
if(light[][] || light[][] || light[][] || light[][] || light[][] || light[][])
ans = true;
}
if(ans)
printf("YES\n");
else
printf("NO\n");
return ;
}
Codeforces Round #417 (Div. 2)-A. Sagheer and Crossroad的更多相关文章
- Codeforces Round #417 (Div. 2) B. Sagheer, the Hausmeister —— DP
题目链接:http://codeforces.com/problemset/problem/812/B B. Sagheer, the Hausmeister time limit per test ...
- Codeforces Round #417 (Div. 2) C. Sagheer and Nubian Market
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- Codeforces Round #417 (Div. 2) D. Sagheer and Kindergarten(树中判祖先)
http://codeforces.com/contest/812/problem/D 题意: 现在有n个孩子,m个玩具,每次输入x y,表示x孩子想要y玩具,如果y玩具没人玩,那么x就可以去玩,如果 ...
- Codeforces Round #417 (Div. 2) B. Sagheer, the Hausmeister
http://codeforces.com/contest/812/problem/B 题意: 有n层楼,每层楼有m个房间,1表示灯开着,0表示灯关了.最两侧的是楼梯. 现在每从一个房间移动到另一个房 ...
- 【二分】Codeforces Round #417 (Div. 2) C. Sagheer and Nubian Market
傻逼二分 #include<cstdio> #include<algorithm> using namespace std; typedef long long ll; ll ...
- 【动态规划】Codeforces Round #417 (Div. 2) B. Sagheer, the Hausmeister
预处理每一层最左侧的1的位置,以及最右侧的1的位置. f(i,0)表示第i层,从左侧上来的最小值.f(i,1)表示从右侧上来. 转移方程请看代码. #include<cstdio> #in ...
- [Codeforces Round#417 Div.2]
来自FallDream的博客,未经允许,请勿转载,谢谢. 有毒的一场div2 找了个1300的小号,结果B题题目看错没交 D题题目剧毒 E题差了10秒钟没交上去. 233 ------- A.Sag ...
- Codeforces Round #417 (Div. 2)A B C E 模拟 枚举 二分 阶梯博弈
A. Sagheer and Crossroads time limit per test 1 second memory limit per test 256 megabytes input sta ...
- Codeforces Round #417 (Div. 2) 花式被虐
A. Sagheer and Crossroads time limit per test 1 second memory limit per test 256 megabytes input sta ...
随机推荐
- 翻译:JVM虚拟机规范1.7中的运行时常量池部分(三)
4.4.7. The CONSTANT_Utf8_info Structure The CONSTANT_Utf8_info structure is used to represent consta ...
- Python求解啤酒问题(携程2016笔试题)
问题描述:一位酒商共有5桶葡萄酒和1桶啤酒,6个桶的容量分别为30升.32升.36升.38升.40升和62升,并且只卖整桶酒,不零卖.第一位顾客买走了2整桶葡萄酒,第二位顾客买走的葡萄酒是第一位顾客的 ...
- 关于python 使用腾讯云OCR 通用印刷体识别
腾讯的python SDK没有通用印刷体识别,所以参考了别人识别网上图片的方式:https://www.cnblogs.com/semishigure/p/7690789.html 但是咱们使用的基本 ...
- Headless Chrome:服务端渲染JS站点的一个方案【中篇】【翻译】
接上篇 防止重新渲染 其实说不对客户端代码做任何修改是忽悠人的.在我们的Express 应用中,通过Puppteer加载页面,提供给客户端响应,但是这个过程是有一些问题的. js脚本在服务端的Head ...
- spark-shell报错:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
环境: openSUSE42.2 hadoop2.6.0-cdh5.10.0 spark1.6.0-cdh5.10.0 按照网上的spark安装教程安装完之后,启动spark-shell,出现如下报错 ...
- Python 爬取猫眼电影最受期待榜
主要爬取猫眼电影最受期待榜的电影排名.图片链接.名称.主演.上映时间. 思路:1.定义一个获取网页源代码的函数: 2.定义一个解析网页源代码的函数: 3.定义一个将解析的数据保存为本地文件的函数: ...
- [HNOI 2010]Bus 公交线路
Description 题库链接 有 \(N\) 个车站, \(K\) 条公交线路.第 \(1\) 到 \(K\) 站是这 \(K\) 线路的起点站.第 \(N-K+1\) 到 \(N\) 是终点站. ...
- [HNOI 2016]最小公倍数
Description 题库链接 给定一张 \(N\) 个顶点 \(M\) 条边的无向图(顶点编号为 \(1,2,\cdots,n\) ),每条边上带有权值.所有权值都可以分解成 \(2^a\time ...
- [SDOI 2008]沙拉公主的困惑
Description 大富翁国因为通货膨胀,以及假钞泛滥,政府决定推出一项新的政策:现有钞票编号范围为1到N的阶乘,但是,政府只发行编号与M!互质的钞票.房地产第一大户沙拉公主决定预测一下大富翁国现 ...
- [测试题]line
Description Input Output Sample Input 10 49743636 36679 707182 9310618 9814768 2315242 9916077 35233 ...