結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2017-02-27 04:17:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 593 bytes |
コンパイル時間 | 457 ms |
コンパイル使用メモリ | 66,952 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-11 17:51:00 |
合計ジャッジ時間 | 1,164 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream> #include <string> using namespace std; using ll = long long; int main() { string a, b; cin >> a >> b; bool f = true; for(int i=0; i<a.size(); ++i) { f &= isdigit(a[i]); } for(int i=0; i<b.size(); ++i) { f &= isdigit(b[i]); } if((a[0] != '0' || a.size() == 1) && (b[0] != '0' || b.size() == 1) && f) { int A = stoi(a), B = stoi(b); if(A <= 12345 && B <= 12345) { cout << "OK" << endl; } else { cout << "NG" << endl; } } else { cout << "NG" << endl; } }