結果
| 問題 | No.653 E869120 and Lucky Numbers | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-02-13 23:11:14 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 284 bytes | 
| コンパイル時間 | 521 ms | 
| コンパイル使用メモリ | 65,764 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-06 06:40:35 | 
| 合計ジャッジ時間 | 1,598 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 6 | 
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
using namespace std;
string p;
bool ok=true;
main()
{
	cin>>p;
	for(int i=0;i+1<p.size();i++)
	{
		if(p[i]=='0')ok=false;
		else p[i]--;
	}
	if(p[0]!='0')ok=false;
	for(int i=1;i<p.size();i++)
	{
		if(p[i]<'2'||'4'<p[i])ok=false;
	}
	cout<<(ok?"Yes":"No")<<endl;
}
            
            
            
        