結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー MicrobeMicrobe
提出日時 2017-03-25 00:43:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 806 bytes
コンパイル時間 1,812 ms
コンパイル使用メモリ 163,912 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-20 07:23:53
合計ジャッジ時間 2,795 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,384 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	string a, b;
	cin >> a >> b;
	if(a[0] != '0' && b[0] != '0') {
		rep(i, a.size()) {
			if(a[i] < '0' || a[i] > '9') {
				printf("NG\n");
				return 0;
			} 
		}
		if(5 > a.size()) printf("OK\n");
		else if("12345" >= a) printf("OK\n");
		else printf("NG\n");
		rep(i, b.size()) {
			if(b[i] < '0' || b[i] > '9') {
				printf("NG\n");
				return 0;
			} 
		}
		if(5 > b.size()) printf("OK\n");
		else if("12345" >= b) printf("OK\n");
		else printf("NG\n");
	}
	else printf("NG\n");
	return 0;
}
0