結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2019-12-05 22:53:47 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 598 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-23 03:14:39 |
合計ジャッジ時間 | 2,795 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 27 WA * 6 |
ソースコード
def target_index(l, x, default=999): if x in l: return l.index(x) else: return default list_0 = input().split('.') list_1 = input().split('.') rel = [] for i in range(3): if int(list_0[i]) == int(list_1[i]): rel.append(0) elif int(list_0[i]) > int(list_1[i]): rel.append(-1) elif int(list_0[i]) < int(list_1[i]): rel.append(1) judge_list = [i <= 0 for i in rel] res = 0 if all(judge_list) == True: res = 1 if target_index(rel, -1) == 0: res = 1 else: res = 0 if res == 1: print('YES') else: print('NO')