結果

問題 No.293 4>7の世界
コンテスト
ユーザー Theta
提出日時 2022-11-15 16:38:09
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 1,296 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 379 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 15,484 KB
最終ジャッジ日時 2026-04-05 20:42:03
合計ジャッジ時間 3,718 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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