結果

問題 No.293 4>7の世界
ユーザー Theta
提出日時 2022-11-15 16:38:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 1,296 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-16 16:01:37
合計ジャッジ時間 1,904 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    A, B = input().split()

    if len(A) > len(B):
        print(A)
        return

    if len(B) > len(A):
        print(B)
        return

    for a_elm, b_elm in zip(A, B):
        match a_elm:
            case "4":
                match b_elm:
                    case "7":
                        print(A)
                        return
                    case "4":
                        continue
                    case num:
                        if 4 > int(num):
                            print(A)
                        else:
                            print(B)
                        return
            case "7":
                match b_elm:
                    case "4":
                        print(B)
                        return
                    case "7":
                        continue
                    case num:
                        if 7 > int(num):
                            print(A)
                        else:
                            print(B)
                        return
            case num:
                if int(num) < int(b_elm):
                    print(B)
                    return
                if int(num) > int(b_elm):
                    print(A)
                    return


if __name__ == "__main__":
    main()
0