結果
問題 |
No.653 E869120 and Lucky Numbers
|
ユーザー |
|
提出日時 | 2019-08-06 17:05:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,206 bytes |
コンパイル時間 | 701 ms |
コンパイル使用メモリ | 94,676 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 14:06:59 |
合計ジャッジ時間 | 1,382 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 7 |
ソースコード
#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 under_num = 0; cin >> s; for (int i = 0; i < s.length(); i++) { if (under_num == 0 && i != 0) { if (s[s.length() - i - 1] != '7' || s[s.length() - i - 1] != '6') { cout << "No" << endl; return 0; } } 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; } 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) ){ cout << "No" << endl; return 0; } } cout << "Yes"<< endl; return 0; }