結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2018-03-25 02:09:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 873 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-30 12:36:53 |
合計ジャッジ時間 | 1,977 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
# -*- coding: utf-8 -*- """ No.293 4>7の世界 https://yukicoder.me/problems/no/293 """ import sys from sys import stdin input = stdin.readline class Number: def __init__(self, s): self.s = s def __lt__(self, other): if len(self.s) < len(other.s): return True elif len(self.s) == len(other.s): for a, b in zip(self.s, other.s): if a != b: if (a == '4' and b == '7') or (a == '7' and b == '4'): return not a < b else: return a < b return False else: return False def __str__(self): return self.s def main(args): A, B = map(Number, input().split()) if A < B: print(B) else: print(A) if __name__ == '__main__': main(sys.argv[1:])