結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー HIBIKU
提出日時 2016-12-31 17:47:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 433 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 57,700 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-16 04:35:11
合計ジャッジ時間 1,666 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 10 RE * 3
権限があれば一括ダウンロードができます

ソースコード

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