結果

問題 No.138 化石のバージョン
コンテスト
ユーザー _KingdomOfMoray
提出日時 2019-12-05 22:53:47
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 598 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,132 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-10-06 08:03:18
合計ジャッジ時間 3,290 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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')
0