結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-11-18 22:29:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 404 bytes |
コンパイル時間 | 1,821 ms |
コンパイル使用メモリ | 159,984 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 07:04:44 |
合計ジャッジ時間 | 1,963 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#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<<"NG"<<endl;}