結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー ichibanshiboriichibanshibori
提出日時 2016-11-18 22:36:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 9,204 KB
最終ジャッジ日時 2023-08-17 11:06:59
合計ジャッジ時間 1,331 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,056 KB
testcase_01 AC 25 ms
9,024 KB
testcase_02 AC 25 ms
8,900 KB
testcase_03 AC 24 ms
9,184 KB
testcase_04 AC 23 ms
9,108 KB
testcase_05 AC 24 ms
9,088 KB
testcase_06 AC 23 ms
9,120 KB
testcase_07 AC 23 ms
8,948 KB
testcase_08 AC 24 ms
9,108 KB
testcase_09 AC 23 ms
8,952 KB
testcase_10 AC 23 ms
9,020 KB
testcase_11 AC 24 ms
8,936 KB
testcase_12 AC 23 ms
8,980 KB
testcase_13 AC 24 ms
9,144 KB
testcase_14 AC 23 ms
9,104 KB
testcase_15 AC 23 ms
9,204 KB
testcase_16 AC 23 ms
9,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

input_pattern = re.compile(r'^([1-9]\d*)$')

def check(in_str):
    if len(in_str) < 1 or len(in_str) > 5: return False
    if in_str == '0': return True
    if input_pattern.match(in_str) is None: return False
    return int(in_str) <= 12345

A = input()
B = input()

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