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:
parent
5e3a377aa6
commit
6198b3d6c9
32
Codeforces/320/A/A.cpp
Normal file
32
Codeforces/320/A/A.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user