結果

問題 No.653 E869120 and Lucky Numbers
ユーザー ああいいああいい
提出日時 2022-01-09 22:14:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 954 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 61,696 KB
最終ジャッジ日時 2024-04-26 19:55:28
合計ジャッジ時間 2,586 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,968 KB
testcase_01 AC 44 ms
57,856 KB
testcase_02 AC 45 ms
58,880 KB
testcase_03 AC 46 ms
58,880 KB
testcase_04 AC 45 ms
57,600 KB
testcase_05 AC 40 ms
57,856 KB
testcase_06 AC 43 ms
59,904 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 AC 40 ms
58,240 KB
testcase_09 AC 37 ms
52,096 KB
testcase_10 AC 37 ms
51,968 KB
testcase_11 AC 37 ms
51,712 KB
testcase_12 AC 38 ms
52,096 KB
testcase_13 AC 39 ms
52,096 KB
testcase_14 AC 37 ms
51,712 KB
testcase_15 AC 38 ms
51,712 KB
testcase_16 AC 38 ms
51,840 KB
testcase_17 WA -
testcase_18 AC 38 ms
52,004 KB
testcase_19 AC 38 ms
51,968 KB
testcase_20 AC 37 ms
52,224 KB
testcase_21 AC 38 ms
51,968 KB
testcase_22 AC 38 ms
51,584 KB
testcase_23 AC 38 ms
51,584 KB
testcase_24 AC 37 ms
51,840 KB
testcase_25 AC 38 ms
52,096 KB
testcase_26 AC 38 ms
52,096 KB
testcase_27 AC 36 ms
52,352 KB
testcase_28 AC 46 ms
61,568 KB
testcase_29 AC 46 ms
61,696 KB
testcase_30 WA -
testcase_31 AC 42 ms
52,096 KB
testcase_32 AC 40 ms
52,096 KB
testcase_33 AC 40 ms
52,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p = input()

l = list(map(int,list(p)))

import sys
if len(l) == 1:
    print('No')
    exit()
n = 'No'
y = 'Yes'
if 2 <= l[-1] <= 4:
    pass
else:
    print(n)
    exit()

if l[0] == 1:
    for i in l[1:-1]:
        if 3 <= i <= 5:
            pass
        else:
            print(n)
            exit()
    print(y)
    exit()
if p.count('8') >= 2:
    print(n)
    exit()
if p.count('8') == 1:
    i = 0
    while l[i] != 8:
        if l[i] != 6 and l[i] != 7:
            print(n)
            exit()
        i += 1
    i += 1
    for j in range(i,len(l)-1):
        if 3 <= l[j] <= 5:
            pass
        else:
            print(n)
            exit()
    print(y)
    exit()
a = p.count('6') + p.count('7')
if a == 0:
    print(n)
    exit()
    
for i in range(a):
    if l[i] != 6 and l[i] != 7:
        print(n)
        exit()
for j in range(a,len(l)-1):
    if 3 <= l[j] <= 5:
        pass
    else:
        print(n)
        exit()
print(y)
0