結果
| 問題 | No.653 E869120 and Lucky Numbers | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-06-23 10:57:58 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 318 bytes | 
| コンパイル時間 | 2,904 ms | 
| コンパイル使用メモリ | 191,488 KB | 
| 最終ジャッジ日時 | 2025-01-11 09:32:01 | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 6 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
	string s; cin>>s;
	reverse(s.begin(),s.end());
	int carry=0;
	rep(i,s.length()-1){
		int a=s[i]-'0';
		if(a-carry<2 || 4<a-carry) return puts("No"),0;
		carry=1;
	}
	puts(s.back()-'0'==1?"Yes":"No");
	return 0;
}
            
            
            
        