結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー Nasatame
提出日時 2016-11-18 22:56:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 56,428 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-26 07:37:27
合計ジャッジ時間 963 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 8 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <stdexcept>
using namespace std;
int main(void){
    // Here your code !
    string a,b;
    cin >> a >> b;
    try{
    stoi(a,nullptr,10);
    stoi(b,nullptr,10);
    
    if( a[0] == '0' && a.size() != 1){
        if( b[0] == '0' && b.size() != 1){
            cout << "NG" << endl;
        }else{
            cout << "OK" << endl;
        }
    }else{
        cout << "OK" << endl;
    }
        
    }catch(const std::logic_error& e){
        cout << "NG" << endl;
    }
}
0