結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
|
提出日時 | 2017-07-01 11:03:08 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 855 bytes |
コンパイル時間 | 571 ms |
コンパイル使用メモリ | 75,644 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-05 03:24:19 |
合計ジャッジ時間 | 1,254 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 8 WA * 5 |
ソースコード
#include<cstdio> #include <iostream> #include<algorithm> #include<string> #include<queue> #include<vector> #include<functional> #include<cmath> #include<map> #include<stack> #include<set> #include<numeric> #define mod 1000000007; using namespace std; typedef long long ll; typedef pair<ll, ll> Pr; string A, B; int main() { cin >> A >> B; for (int i = 0; i < A.size(); i++) { if (!(A[i] >= '0' && A[i] <= '9')) { cout << "NG" << endl; return 0; } } for (int i = 0; i < B.size(); i++) { if (!(B[i] >= '0' && B[i] <= '9')) { cout << "NG" << endl; return 0; } } int len_a = A.size(), len_b = B.size(); string num_a = to_string(stoi(A)), num_b = to_string(stoi(B)); if (len_a != num_a.size() || len_b != num_b.size() || num_a > "12345" || num_b > "12345") cout << "NG" << endl; else cout << "YES" << endl; return 0; }