結果

問題 No.653 E869120 and Lucky Numbers
ユーザー aonek0aonek0
提出日時 2019-08-06 17:07:06
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,251 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 92,932 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 17:55:21
合計ジャッジ時間 2,085 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,380 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 WA -
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
		}
	}

	if(under_num==0)cout << "Yes"<< endl;
	else cout << "No" << endl;
	return 0;
}
0