結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
kichirb3
|
| 提出日時 | 2018-03-03 16:48:32 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 769 bytes |
| コンパイル時間 | 298 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-30 04:43:14 |
| 合計ジャッジ時間 | 1,258 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
# -*- coding: utf-8 -*-
"""
No.446 ゆきこーだーの雨と雪 (1)
https://yukicoder.me/problems/no/446
"""
import sys
from sys import stdin
input = stdin.readline
def solve(A, B):
try:
num_a = int(A)
num_b = int(B)
except:
return 'NG'
if not 0 <= num_a <= 12345:
return 'NG'
if not 0 <= num_b <= 12345:
return 'NG'
if num_a == 0 and len(A) > 1:
return 'NG'
if num_b == 0 and len(B) > 1:
return 'NG'
if A[0] == '0' and num_a != 0:
return 'NG'
if B[0] == '0' and num_b != 0:
return 'NG'
return 'OK'
def main(args):
A = input().strip()
B = input().strip()
ans = solve(A, B)
print(ans)
if __name__ == '__main__':
main(sys.argv[1:])
kichirb3