結果

問題 No.653 E869120 and Lucky Numbers
ユーザー takentatakenta
提出日時 2018-02-24 00:03:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 692 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-18 12:00:25
合計ジャッジ時間 1,956 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

p = list(map(int, list(input())))
u1 = (2, 3, 4)
u2 = (3, 4, 5, 6, 7, 8)
u3 = (1, 6, 7, 8)

p.reverse()
print(p)

if p[-1] == 1 and p[0] in (2, 3, 4) and all([e in (3, 4, 5) for e in p[1:-1]]):
    print('Yes')
elif p[-1] in (6, 7, 8) and p[0] in (2, 3, 4):
    if 8 in p[:-1]:
        if all([e in (6, 7) for e in p[p.index(8)+1:]]) and all([e in (3, 4, 5) for e in p[1:p.index(8)]]):
            print('Yes')
        else:
            print('No')
    elif 7 in p[-1]:
        if all([e in (6, 7) for e in p[p.index(7)+1:]]) and all([e in (3, 4, 5) for e in p[1:p.index(7)]]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
0