goodbye 2016 B New Year and North Pole
来源:互联网 发布:淘宝商家投诉买家 编辑:程序博客网 时间:2024/05/21 10:03
点击打开链接
水题,我却错了一大堆,,,,
欸,,没看懂题,我以为站在南极,其他任意方向都是向北,所以这样写GG了,
结果是只要判断指示是否完全正确,一旦不合常理,就算完蛋。
欧,,,天啊,炸了。
#include <bits/stdc++.h>using namespace std;int main(){ int T,n,ans=0,f=1; char arr[10]; scanf("%d",&T); while(T--){ scanf("%d %s",&n,arr); if((ans==0&&arr[0]!='S')||(ans==20000&&arr[0]!='N')) f=0; if(arr[0]=='N') ans-=n; if(arr[0]=='S') ans+=n; if(ans<0||ans>20000) f=0; } if(ans!=0||f==0) printf("NO\n"); else printf("YES\n"); return 0;}
0 0
- goodbye 2016 B New Year and North Pole
- 750B. New Year and North Pole
- B. New Year and North Pole
- 750B New Year and North Pole
- codeforces Good Bye 2016-B New Year and North Pole
- New Year and North Pole
- 【codeforces 750B】New Year and North Pole
- 【Codeforces 750 B New Year and North Pole 】+ 手速
- New Year and North Pole CodeForces
- goodbye 2016 A New Year and Hurry
- Codeforences Goodbye 2015 B New Year and Old Property
- codeforces goodbye 2016 C. New Year and Rating
- 【Goodbye 2016】 D. New Year and Fireworks【暴力+姿势剪枝】【今年最后一发题解了啊!】
- GoodBye 2016 C. New Year and Rating 详解(维护不等式)
- Codeforences Goodbye 2015 C. New Year and Domino
- B. New Year and Old Property
- B. New Year Present
- B - New Year Permutation
- mysql 中 unix_timestamp和from_unixtime 时间戳函数
- 数据结构实验之链表六:有序链表的建立
- 377. Combination Sum IV
- python基本变量和函数基础
- QtChart官方自带example(Callout)X轴坐标逆序后遇到的问题,求大神指点
- goodbye 2016 B New Year and North Pole
- C# 如何后台判断 file控件上传的文件类型
- 17 - 03 - 26 图解HTTP(30)
- linux下裁剪可执行文件
- MySQL入门之C语言操作MySQL
- 单例设计模式
- JAVA异常处理
- zoj2425
- High "Resmgr:Cpu Quantum" Wait Events In 11g Even When Resource Manager Is Disabled (文档 ID 949033.1)