結果

問題 No.446 ゆきこーだーの雨と雪 (1)
コンテスト
ユーザー HIBIKU
提出日時 2016-12-31 17:47:23
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 433 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 402 ms
コンパイル使用メモリ 74,880 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-05-26 09:57:47
合計ジャッジ時間 2,175 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 10 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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