結果

問題 No.653 E869120 and Lucky Numbers
ユーザー
提出日時 2020-10-24 11:07:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 581 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 93,736 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-21 15:03:15
合計ジャッジ時間 2,249 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	string s;
	cin >> s;
	int n = s.size();
	for (int i = n - 1; i > 0; i--) {
		if (s[i] >= '2' && s[i] <= '4') {
			s[i - 1]--;
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}
	if (s[0] == '0') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}
0