Codeforces Round #189 (Div. 2) A. Magic Numbers
#include <iostream>
#include <vector>
#include <algorithm>
#include <string> using namespace std; int main(){
long long n;
cin >>n;
while(n){
if(n%10 == 1) n/=10;
else if(n%100 == 14 ) n/=100;
else if(n%1000 == 144) n/=1000;
else { cout<<"NO"<<endl;return 0;}
}
cout<<"YES"<<endl;
return 0;
}
Codeforces Round #189 (Div. 2) A. Magic Numbers的更多相关文章
- Codeforces Round #189 (Div. 2) A. Magic Numbers【正难则反/给出一个数字串判断是否只由1,14和144组成】
A. Magic Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
- 构造 Codeforces Round #107 (Div. 2) B. Phone Numbers
题目传送门 /* 构造:结构体排个序,写的有些啰嗦,主要想用用流,少些了判断条件WA好几次:( */ #include <cstdio> #include <algorithm> ...
- Codeforces Round #189 (Div. 1 + Div. 2)
A. Magic Numbers 不能出现连续的3个4,以及1.4以外的数字. B. Ping-Pong (Easy Version) 暴力. C. Malek Dance Club 考虑\(x\)二 ...
- Codeforces Round #335 (Div. 2) A. Magic Spheres 水题
A. Magic Spheres Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/606/ ...
- Codeforces Round #443 (Div. 1) D. Magic Breeding 位运算
D. Magic Breeding link http://codeforces.com/contest/878/problem/D description Nikita and Sasha play ...
- Codeforces Round #335 (Div. 2) A. Magic Spheres 模拟
A. Magic Spheres Carl is a beginner magician. He has a blue, b violet and c orange magic spheres. ...
- Codeforces Round #181 (Div. 2) C. Beautiful Numbers 排列组合 暴力
C. Beautiful Numbers 题目连接: http://www.codeforces.com/contest/300/problem/C Description Vitaly is a v ...
- Codeforces Round #350 (Div. 2) D1. Magic Powder - 1 二分
D1. Magic Powder - 1 题目连接: http://www.codeforces.com/contest/670/problem/D1 Description This problem ...
- Codeforces Round #515 (Div. 3) E. Binary Numbers AND Sum
E. Binary Numbers AND Sum 题目链接:https://codeforces.com/contest/1066/problem/E 题意: 给出两个用二进制表示的数,然后将第二个 ...
随机推荐
- Linux下列格式化工具 - column
[root@localhost ~]# mount/dev/sda2 on / type ext4 (rw)proc on /proc type proc (rw)sysfs on /sys type ...
- python遍历数组的两种方法
第一种,最常用的,通过for in遍历数组 1 2 3 4 5 6 7 8 colours = ["red","green","blue"] ...
- 项目总结(四)--- 网络封包分析工具Charles
Charles是Mac下一款截取网络封包的工具,主要原理就是将自己设置成为熊网络访问的代理服务器,这样的话,所有的网络请求都得通过它来完成,从而实现网络封包的拦截分析. 这款软件功能整体来说还是非常强 ...
- vector.end() 指向的节点
存储器vector, vector.end() 指向的是最后的结束符,而不是最后一个元素.
- 解决Tomcat 6.0 只支持 J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules
通过search,发现在project的.setting folder下面,有个名为org.eclipse.wst.common.project.facet.core.xml的文件,里面配置有各种版本 ...
- 食物链(codevs 1074)
题目描述 Description 动物王国中有三类动物 A,B,C,这三类动物的食物链构成了有趣的环形.A吃B,B吃C,C吃A. 现有N个动物,以1-N编号.每个动物都是A,B,C中的一种,但是我们并 ...
- Java编程设计2
一般我们会以这种设计方式生产对象实例,如: 创建一个接口: public interface TestOpen { String getVirtualHost(); String getCapabil ...
- Android 系统默认参数的修改
转自: http://www.th7.cn/Program/Android/201505/447097.shtml 写在前面的话 一般在新项目开始之初,我们需要针对客户需求进行各种系统默认属性的配置, ...
- PHP CI框架学习笔记-分页实现程序
视图html <div id="body"> <form action="/index.php/search/index/" method= ...
- vijos 1028 LIS *
链接:点我 #include<cstdio> #include<iostream> #include<algorithm> #include<cstring& ...