結果

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

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main(){
	string p;
	cin >> p;
	int N = p.size();
	bool ok = true;
	if (p[0] != '1'){
		ok = false;
	}
	if (!('2' <= p[N - 1] && p[N - 1] <= '4')){
		ok = false;
	}
	for (int i = 1; i < N - 1; i++){
		if (!('3' <= p[i] && p[i] <= '5')){
			ok = false;
		}
	}
	if (ok){
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}
0