結果
問題 | No.653 E869120 and Lucky Numbers |
ユーザー | takenta |
提出日時 | 2018-02-23 23:55:51 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 722 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-04-18 11:48:58 |
合計ジャッジ時間 | 2,396 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
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 | - |
ソースコード
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[-1:p.index(8, -1):-1]]) and all([e in (3, 4, 5) for e in p[:p.index(8, -1)+1:-1]]): print('Yes') else: print('No') elif 7 in p[-1]: if all([e in (6, 7) for e in p[-1:p.index(7, -1):-1]]) and all([e in (3, 4, 5) for e in p[:p.index(7, -1)+1:-1]]): print('Yes') else: print('No') else: print('No') else: print('No')