結果

問題 No.293 4>7の世界
ユーザー akanayaakanaya
提出日時 2020-04-01 21:50:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 683 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 8,024 KB
最終ジャッジ日時 2023-09-09 17:55:53
合計ジャッジ時間 1,733 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 RE -
testcase_04 AC 16 ms
7,788 KB
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 15 ms
7,848 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 WA -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 WA -
testcase_22 RE -
testcase_23 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = list(map(int, input().split(' ')))

def compare(a, b):
    def _compare(al, bl):
        if len(al) < len(bl):
            return True
        elif len(al) > len(bl) or (len(al) == 0 and len(bl) == 0):
            return False
        else:
            if al[0] == 4 or b[0] == 7:
                return True
            elif al[0] == 7 or b[0] == 4:
                return True
            elif al[0] != bl[0]:
                return False
            else:
                return _compare(al[1:], bl[1:])
            
    al = list(map(int, list(str(a))))
    bl = list(map(int, list(str(b))))
    return _compare(al, bl)


if compare(a, b):
    print(a)
else:
    print(b)
0