結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2016-12-27 22:30:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 994 bytes |
コンパイル時間 | 820 ms |
コンパイル使用メモリ | 93,568 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-15 04:48:57 |
合計ジャッジ時間 | 1,513 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 11 WA * 2 |
ソースコード
#include <iostream> #include <vector> #include <set> #include <queue> #include <algorithm> #include <string> #include <cmath> #include <functional> #include <iomanip> #include <map> #define _USE_MATH_DEFINES #include <math.h> using namespace std; #define MAX 100000 char ic[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; int main() { string a, b; bool f = true; bool zero = true; cin >> a >> b; for (int i = 0; i < a.length(); ++i) { if (find(ic, ic + 10, a[i]) == end(ic)) { f = false; break; } else { if (zero) { if (i != a.length() - 1 && a[i] == '0') { f = false; break; } else { zero = false; } } } } for (int i = 0; i < b.length() && f; ++i) { if (find(ic, ic + 10, b[i]) == end(ic)) { f = false; break; } else { if (zero) { if (i != b.length() - 1 && b[i] == '0') { f = false; break; } else { zero = false; } } } } cout << (f ? "OK" : "NG") << endl; return 0; }