結果

問題 No.446 ゆきこーだーの雨と雪 (1)
コンテスト
ユーザー koheijkt
提出日時 2026-03-22 12:07:24
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 360 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 236 ms
コンパイル使用メモリ 84,956 KB
実行使用メモリ 53,524 KB
最終ジャッジ日時 2026-03-22 12:07:28
合計ジャッジ時間 1,647 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

A = input()
B = input()

nums = '0123456789'

def check(s):
    for ss in s:
        if ss in nums:
            continue
        else:
            return False
    # leading-zero 判定
    if len(str(int(s))) != len(s):
        return False
    # 大きさ判定
    return 0 <= int(s) <= 12345

if check(A) and check(B):
    print('OK')
else:
    print('NG')
0