0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

A - Magic Numbers

https://codeforces.com/contest/320/submission/178748089
This commit is contained in:
Baoshuo Ren 2022-11-01 08:27:43 +08:00
parent 5e3a377aa6
commit 6198b3d6c9
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

32
Codeforces/320/A/A.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
int n;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
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;
exit(0);
}
}
cout << "YES" << endl;
return 0;
}