結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2017-01-02 20:01:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,317 bytes |
コンパイル時間 | 611 ms |
コンパイル使用メモリ | 71,740 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-16 05:19:01 |
合計ジャッジ時間 | 1,321 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include <vector> #include <algorithm> #include <map> #include <bitset> #include <stack> #include <queue> using namespace std; #define len(n) (int)n.length() #define dump cout #define pb push_back #define ll long long #define make_pair mkp typedef pair<ll, ll> LLARR; int main() { ios::sync_with_stdio(false); string s[2]; cin >> s[0]; cin >> s[1]; bool isOK = true; for (int i = 0; i < 2; i++) { bool nA = true; for (int k = 0; k < len(s[i]); k++) { if ((s[i][k] >= '1') && (s[i][k] <= '9')) { nA = false; } else if (s[i][k] == '0') { if (nA && (len(s[i]) > 1)) { isOK = false; break; } } else { isOK = false; break; } } if (isOK) { int tmp = stoi(s[i]); if ((0 > tmp) || ( tmp > 12345)) isOK = false; } } if (!isOK) { cout << "NG" << endl; } else { cout << "OK" << endl; } return 0; }