結果
| 問題 |
No.653 E869120 and Lucky Numbers
|
| コンテスト | |
| ユーザー |
ts_
|
| 提出日時 | 2018-04-06 22:54:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 837 bytes |
| コンパイル時間 | 1,946 ms |
| コンパイル使用メモリ | 158,980 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 10:51:20 |
| 合計ジャッジ時間 | 2,307 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;
int main(){
string s;
cin>>s;
int cur=0;
int n=s.size();
for(int i=n-1;i>=0;--i){
if(cur==0){
if(s[i]=='7'||s[i]=='6');
else if(s[i]=='2'||s[i]=='3'||s[i]=='4') cur=1;
else{
cout<<"No"<<endl;
return 0;
}
}
else if(cur==1){
if(s[i]=='7'||s[i]=='8') cur=0;
else if(s[i]=='3'||s[i]=='4'||s[i]=='5') cur=1;
else if(i==0&&s[i]=='1') cur=0;
else{
cout<<"No"<<endl;
return 0;
}
}
}
cout<<"Yes"<<endl;
return 0;
}
ts_