結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
はまやんはまやん
|
| 提出日時 | 2017-04-20 12:14:51 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 751 bytes |
| コンパイル時間 | 1,567 ms |
| コンパイル使用メモリ | 167,116 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 20:36:56 |
| 合計ジャッジ時間 | 2,439 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
string A, B;
string sol() {
string ng = "NG";
for (char c : A) if (c < '0' || '9' < c) return ng;
for (char c : B) if (c < '0' || '9' < c) return ng;
if (A[0] == '0' && 1 < A.size()) return ng;
if (B[0] == '0' && 1 < B.size()) return ng;
int x;
x = 0;
for (char c : A) x = x * 10 + c - '0';
if (12345 < x) return ng;
x = 0;
for (char c : B) x = x * 10 + c - '0';
if (12345 < x) return ng;
return "OK";
}
//-----------------------------------------------------------------------------------
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> A >> B;
cout << sol() << endl;
}
はまやんはまやん