結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-08-15 19:58:44 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 887 bytes |
| コンパイル時間 | 909 ms |
| コンパイル使用メモリ | 105,448 KB |
| 最終ジャッジ日時 | 2025-02-16 08:26:33 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;
#ifdef _WIN32
#include <Windows.h>
#endif
int main()
{
string a;
bool ok = false;
for (int i = 0; i < 2; i++){
cin >> a;
if ((a.size() > 5)){
cout << "NG" << endl;
return 0;
}
for (int j = 0; j < a.size(); j++){
if (a[j] < '0' || a[j] > '9'){
cout << "NG" << endl;
return 0;
}
if ((a[j] >= '1' && a[j] <='9') || (a[j] == '0' && a.size() == 1))ok = true;
if (((a[j] == '0') && (!ok)) || (stoi(a) > 12345)){
cout << "NG" << endl;
return 0;
}
}
ok = false;
}
cout << "OK" << endl;
}
kpinkcat