結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー yumechiyumechi
提出日時 2016-11-19 00:05:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 63,360 KB
最終ジャッジ日時 2024-11-26 09:00:25
合計ジャッジ時間 2,008 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

def shapingNumber(number: str) -> str:
    shaping = number
    shaping = re.sub("^0+.+", "", shaping)
    shaping = re.sub("[^0-9]", "", shaping)
    return shaping

def isEqualShapingNumber(original: str) -> bool:
    return original == shapingNumber(original)

def solve():
    a, b = input(), input()
    ans = False
    if isEqualShapingNumber(a) and isEqualShapingNumber(b):
        if int(a) <= 12345 and int(b) <= 12345:
            ans = True
    print("OK" if ans else "NG")

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