結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-12-31 17:51:09 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 421 bytes |
コンパイル時間 | 603 ms |
コンパイル使用メモリ | 56,876 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-16 04:35:33 |
合計ジャッジ時間 | 1,230 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream>#include <string>using namespace std;bool solve(string 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 <= stoi(n)&&stoi(n) <= 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;}