結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー Dameningen
提出日時 2017-03-16 19:50:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 65,924 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-04 02:43:27
合計ジャッジ時間 1,155 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 2
権限があれば一括ダウンロードができます

ソースコード

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