結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー mokrai
提出日時 2017-11-13 08:38:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 597 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-25 00:15:44
合計ジャッジ時間 1,297 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def main():
    A = input()
    B = input()

    if is_zero_leading(A) or is_zero_leading(B):
        print("NG")
        sys.exit()

    try:
        int_A = int(A)
        int_B = int(B)
        if int_A < 0 or int_A > 12345:
            print("NG")
        elif int_B < 0 or int_B > 12345:
            print("NG")
        else:
            print("OK")
    except ValueError:
        print("NG")

def is_zero_leading(value):
    if value == "0":
        return False
    elif value[0] == "0":
        return True
    else:
        return False

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