結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-11-18 22:27:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 454 bytes |
コンパイル時間 | 1,595 ms |
コンパイル使用メモリ | 167,676 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 06:42:39 |
合計ジャッジ時間 | 2,241 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool ok(string s) { if(s == "0") return true; if(s[0] == '0') return false; for(int i = 0; i < s.size(); i++) { if(!isdigit(s[i])) return false; } int n = atoi(s.c_str()); return 0 <= n && n <= 12345; } int main() { cin.tie(0); ios::sync_with_stdio(false); string A, B; cin >> A >> B; if(ok(A) && ok(B)) { cout << "OK" << endl; } else { cout << "NG" << endl; } }