結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
|
提出日時 | 2016-11-18 22:33:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 459 bytes |
コンパイル時間 | 684 ms |
コンパイル使用メモリ | 69,888 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 07:15:24 |
合計ジャッジ時間 | 1,198 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 12 WA * 1 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> #include <string> #include <cctype> using namespace std; bool check(string s) { for (char c : s) { if (!isdigit(c)) { return false; } } if (s.size() > 2 && s[0] == '0') { return false; } return stoi(s) <= 12345; } int main() { string a, b; cin >> a >> b; bool ret = check(a) && check(b); cout << (ret ? "OK" : "NG") << endl; return 0; }