結果
問題 |
No.653 E869120 and Lucky Numbers
|
ユーザー |
![]() |
提出日時 | 2018-02-23 23:06:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 909 bytes |
コンパイル時間 | 638 ms |
コンパイル使用メモリ | 79,056 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-10 02:11:43 |
合計ジャッジ時間 | 1,549 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 6 |
ソースコード
#include<vector> #include<iostream> #include<string> #include<algorithm> #include<math.h> #include<map> #include<functional> #include<queue> #include<stack> #include<string.h> #include<list> #define MOD 10000 #define INF 1000000000 #define MAX 101 using namespace std; typedef long long int ll; typedef pair<int,int> P; int main() { string s; cin>>s; int sl=s.length(); bool ans=true; for(int i=0;i<sl;i++){ if(i==0){ if(s[i]!='1'){ ans=false; } }else if(i<sl-1){ if(s[i]!='3'&&s[i]!='4'&&s[i]!='5'){ ans=false; break; } }else{ if(s[i]!='2'&&s[i]!='3'&&s[i]!='4'){ ans=false; break; } } } if(ans){ cout<<"Yes"<<endl; }else{ cout<<"No"<<endl; } }