結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
|
提出日時 | 2020-04-17 20:28:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 2,069 ms |
コンパイル使用メモリ | 192,196 KB |
最終ジャッジ日時 | 2025-01-09 19:36:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>using namespace std;int parse(string x){int res = 0;for(int i = 0; i < x.size(); ++i){if('0' > x[i] or '9' < x[i]) return -1;res *= 10;res += x[i]-'0';}if(res > 12345) return -1;if(x[0] == '0' and res > 0 or x.size() > 1 and res == 0) return -1;return res;}int main(){string a, b;cin >> a >> b;int A = parse(a), B = parse(b);if(A < 0 or B < 0)cout << "NG" << '\n';elsecout << "OK" << '\n';return 0;}