1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main(){
  9. long long n;
  10. cin >>n;
  11. while(n){
  12. if(n%10 == 1) n/=10;
  13. else if(n%100 == 14 ) n/=100;
  14. else if(n%1000 == 144) n/=1000;
  15. else { cout<<"NO"<<endl;return 0;}
  16. }
  17. cout<<"YES"<<endl;
  18. return 0;
  19. }

  

Codeforces Round #189 (Div. 2) A. Magic Numbers的更多相关文章

  1. 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 ...

  2. 构造 Codeforces Round #107 (Div. 2) B. Phone Numbers

    题目传送门 /* 构造:结构体排个序,写的有些啰嗦,主要想用用流,少些了判断条件WA好几次:( */ #include <cstdio> #include <algorithm> ...

  3. Codeforces Round #189 (Div. 1 + Div. 2)

    A. Magic Numbers 不能出现连续的3个4,以及1.4以外的数字. B. Ping-Pong (Easy Version) 暴力. C. Malek Dance Club 考虑\(x\)二 ...

  4. 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/ ...

  5. Codeforces Round #443 (Div. 1) D. Magic Breeding 位运算

    D. Magic Breeding link http://codeforces.com/contest/878/problem/D description Nikita and Sasha play ...

  6. 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. ...

  7. Codeforces Round #181 (Div. 2) C. Beautiful Numbers 排列组合 暴力

    C. Beautiful Numbers 题目连接: http://www.codeforces.com/contest/300/problem/C Description Vitaly is a v ...

  8. Codeforces Round #350 (Div. 2) D1. Magic Powder - 1 二分

    D1. Magic Powder - 1 题目连接: http://www.codeforces.com/contest/670/problem/D1 Description This problem ...

  9. Codeforces Round #515 (Div. 3) E. Binary Numbers AND Sum

    E. Binary Numbers AND Sum 题目链接:https://codeforces.com/contest/1066/problem/E 题意: 给出两个用二进制表示的数,然后将第二个 ...

随机推荐

  1. jekyll中文乱码问题

    一般编写都是采用utf-8的吧,但是在windows下安装的jekyll,默认是以GBK编码的方式去读取咱们编写的文件,如此便乱码了. 要解决此问题,总不至于要写GBK编码的文件吧,毕竟这个编码不怎么 ...

  2. 20个很有用的PHP类库

    介绍20个非常有用的PHP类库,相信一定可以为你的WEB开发提供更好和更为快速的方法. 图表库 下面的类库可以让你很简的创建复杂的图表和图片.当然,它们需要GD库的支持. pChart – 一个可以创 ...

  3. tmux简单使用指南

    一, ubuntu安装tmux sudo apt-get install tmux 二, tmux使用 1)打开shell,输入命令tmux,,shell下边会出现绿色状态条 2)然后同时按下ctrl ...

  4. 【云计算】Dockerfile、镜像、容器快速入门

    Dockerfile.镜像.容器快速入门 1.1.Dockerfile书写示例 Dockerfile可以用来生成Docker镜像,它明确的定义了Image的生成过程.虽然直接修改容器也可以提交生成镜像 ...

  5. Longest Consecutive Sequence

    Given an unsorted array of integers, find the length of the longest consecutive elements sequence. C ...

  6. div隐藏

    <div style="display:none">                 <textarea id="BodyBox2" runa ...

  7. 【USACO】milk3

    倒牛奶的问题, 开始看感觉跟倒水的问题很像, 想直接找规律, 写个类似于循环取余的代码. 但后来发现不行,因为这道题有三个桶,水量也是有限制的.只好用模拟的方法把所有的情况都试一遍. 建一个state ...

  8. Android activity_main.xml删除边缘距离,充满屏幕

    删除android:paddingBottom.android:paddingLeft.android:paddingRight和android:paddingTop四个属性

  9. C语言中的break、continue和goto三者的区别与用法

    exit的话是在stdlib的头文件里面定义的,他是的程序退出,正如exit的字面意思一样break的话是终止当前循环继续进行循环后面的语句,但是程序照样还在进行只能while switch for中 ...

  10. Android之查看网络图片和网页HTML

    网络编程是Android应用中很重要的一部分,本文主要讲述了利用HttpURLConnection获取网络图片和HTML的方法. 获取网络图片 public class MainActivity ex ...