結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー MicrobeMicrobe
提出日時 2017-03-25 00:38:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 1,556 ms
コンパイル使用メモリ 164,076 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 07:22:48
合計ジャッジ時間 3,112 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
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(a > "12345") {
			printf("NG\n");
			return 0;
		}
		rep(i, b.size()) {
			if(b[i] < '0' || b[i] > '9') {
				printf("NG\n");
				return 0;
			} 
		}
		if(b > "12345") {
			printf("NG\n");
			return 0;
		}
		printf("OK\n");
	}
	else printf("NG\n");
	return 0;
}
0