結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー HIBIKUHIBIKU
提出日時 2016-12-31 17:47:23
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 433 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 53,500 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-22 08:58:51
合計ジャッジ時間 2,179 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
bool solve(string n) {
	int num = stoi(n);
	if (n == "0") return true;
	if (n[0]=='0') return false;
	for (auto a : n) {
		if (a <= '9'&&'0' <= a) {

		}
		else return false;
	}
	if (0 <= num&&num <= 12345) return true;
	else return false;
}

int main() {
	string a,b;
	cin >> a >> b;
	if (solve(a) && solve(b)) cout << "OK" << endl;
	else cout << "NG" << endl;
	return 0;
}
0