結果

問題 No.293 4>7の世界
ユーザー gemmarogemmaro
提出日時 2020-05-03 10:17:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-11 15:25:04
合計ジャッジ時間 1,831 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(a: str, b: str):
    if len(a) != len(b):
        return b if len(b) > len(a) else a
    else:
        for (x, y) in zip(map(int, a), map(int, b)):
            if x == 4 and y == 7 or (not (x == 7 and y == 4)) and x > y:
                return a
            elif x == 7 and y == 4 or x < y:
                return b


a, b = input().split()

print(solve(a, b))
0