結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2017-01-02 19:57:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,298 bytes |
コンパイル時間 | 707 ms |
コンパイル使用メモリ | 71,964 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-16 05:18:59 |
合計ジャッジ時間 | 1,421 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 12 WA * 1 |
ソースコード
#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) { 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; }