結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-11-18 22:28:50 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 673 bytes |
コンパイル時間 | 502 ms |
コンパイル使用メモリ | 64,536 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 07:03:59 |
合計ジャッジ時間 | 1,108 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream>#include <string>#include <vector>#include <algorithm>#include <cmath>#include <cstdlib>using namespace std;int main(){string a, b; cin >> a >> b;bool flag = false;if (a.size()!=1 && a[0] == '0')flag = true;for (int i = 0; i < a.size(); i++) {if (a[i] < 48 || a[i]>57)flag = true;}if (!flag) {int na = atoi(a.data());if (na > 12345)flag = true;}if (b.size()!=1 && b[0] == '0')flag = true;for (int i = 0; i < b.size(); i++) {if (b[i] < 48 || b[i]>57)flag = true;}if (!flag) {int nb = atoi(b.data());if (nb > 12345)flag = true;}if (flag)cout << "NG" << endl;else cout << "OK" << endl;return 0;}