問題一覧 > 通常問題

No.446 Rain and Snow of yukicoder (1)

レベル : / AI推定難易度 : 140 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 437
作問者 : りあん / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 1170 / 自分の提出
問題文最終更新日: 2026-06-25 22:25:21
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 154 (順位表) の他の問題:

Problem Statement

Ame-kun is going to help his older sister Yuki, who runs "yukicoder".

The job assigned to Ame-kun this time is to create an easy problem to be used as the first problem of a contest.

So Ame-kun decided to create the following A + B problem.


Problem Statement

Given an integer $A$ on the first line and an integer $B$ on the second line, print $A + B$.

Input

$A$
$B$

All inputs are integers and satisfy the following constraints.

  • $0 \leq A, B \leq 12345$

Output

Print the result of $A + B$ on one line.

Print a newline at the end.


Ame-kun had smoothly made everything up to the test cases, but it turned out that the program generating the test cases was buggy.

So Ame-kun decided to write a program that checks whether a test case satisfies the format and constraints of the problem above.

Note that a case with leading zeros (unnecessary zeros continuing from the beginning of the string) is also considered not to satisfy the format.

Input

$A$
$B$

A string $A$ is given on the first line, and a string $B$ on the second line.

Each string consists only of half-width alphanumeric characters (0-9, A-Z, a-z) and contains no spaces or symbols such as + or -.

The length of each string is guaranteed to be at least 1 and at most 5.

Output

Print "OK" if the input satisfies the format and constraints of the A + B problem above, and "NG" if it does not.

Print a newline at the end.

Sample

Sample 1
Input
123
4eF
Output
NG

"123" is fine, but "4eF" is not a number, so this is invalid.

Sample 2
Input
21000
00012
Output
NG

"21000" is greater than 12345, so it does not satisfy the constraints.

"00012" contains unnecessary zeros at the beginning, so it does not satisfy the format.

Sample 3
Input
FFFF
0x10
Output
NG

Both are invalid.

Sample 4
Input
0
12345
Output
OK

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。