結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー DameningenDameningen
提出日時 2017-03-16 19:50:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 65,876 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-17 05:21:09
合計ジャッジ時間 1,347 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,500 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string a, b;
    cin >> a >> b;
    bool f = true;
    
    for (int i = 0; i < a.size(); i++) {
        f &= isdigit(a[i]);
    }
    for (int i = 0; i < b.size(); i++) {
        f &= isdigit(b[i]);
    }
    
    if ( (a[0] != 0 || a.size() == 1) && (b[0] != 0 || b.size() == 1) && f)
    {
        int A = stoi(a), B = stoi(b);
        if (A <= 12345 && B <= 12345)
        {
            cout << "OK" << endl;
        }
        else
        {
            cout << "NG" << endl;
        }
    }
    else
    {
        cout << "NG" << endl;
    }
    
    return 0;
}
0