結果

問題 No.293 4>7の世界
ユーザー 👑 Kazun
提出日時 2020-06-12 02:55:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,640 KB
実行使用メモリ 53,812 KB
最終ジャッジ日時 2024-06-24 03:36:46
合計ジャッジ時間 2,086 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
A,B=input().split()

if len(A)<len(B):
    print(B)
    sys.exit()
elif len(A)>len(B):
    print(A)
    sys.exit()

f=0
n=len(A)
for i in range(n):
    if f!=0:
        continue
    
    T=(A[i],B[i])
    if T==("4","7") or T==("7","4"):
        if A[i]=="4":
            f=1
        else:
            f=-1
    elif A[i]!=B[i]:
        if int(A[i])<int(B[i]):
            f=-1
        else:
            f=1

if f==1:
    print(A)
else:
    print(B)
0