結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー dohatsutsudohatsutsu
提出日時 2016-11-18 22:24:57
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 1,364 ms
コンパイル使用メモリ 161,964 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-26 06:36:40
合計ジャッジ時間 1,759 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 5 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

bool check(string s){
  if(s=="0")return true;
  if(s[0]=='0')return false;
  for(char ch:s){
    if('0'<=ch&&ch<='9'){
    }else{
      return false;
    }
  }

  int num;
  stringstream ss;
  ss<<s;
  ss>>num;

  return (0<=num && num<= 12345);
}

int main(){
  string A,B;
  cin>>A>>B;
  if(check(A)&&check(B))cout<<"OK"<<endl;
  else cout<<"NO"<<endl;
}
0