結果
問題 |
No.653 E869120 and Lucky Numbers
|
ユーザー |
|
提出日時 | 2019-08-06 17:15:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,162 bytes |
コンパイル時間 | 670 ms |
コンパイル使用メモリ | 94,816 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 14:07:22 |
合計ジャッジ時間 | 1,461 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 WA * 3 |
ソースコード
#include<iostream> #include <algorithm> #include <functional> #include<vector> #include<math.h> #include<bitset> #include<string> #include <deque> #include<queue> #include <iomanip> #include<map> #include <random> #include<type_traits> #include<stack> #include <sstream> #include <limits> #include <numeric> #include<string.h> #include<set> using namespace std; #define ll long long int ll mod = 1000000007; //typedef vector<int> V; //typedef vector<V> VV; //typedef vector<VV> VVV; int main() { string s; int f=0,under_num = 0; cin >> s; for (long long int i = 0; i < s.length(); i++) { if (((s[s.length() - i - 1]-'0')-under_num== 3)|| ((s[s.length() - i - 1] - '0') - under_num == 4)|| ((s[s.length() - i - 1] - '0') - under_num == 2)) { under_num = 1; f = 1; } else if(((s[s.length() - i - 1] - '0') - under_num == 7)|| ((s[s.length() - i - 1] - '0') - under_num == 6)){ under_num = 0; } else if ((s[s.length() - i - 1] - '0') - under_num == 0 && i == s.length() - 1) { under_num = 0; } else { cout << "No" << endl; return 0; } } if(under_num==0&&f==1)cout << "Yes"<< endl; else cout << "No" << endl; return 0; }