結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
|
提出日時 | 2016-11-18 22:53:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 502 bytes |
コンパイル時間 | 502 ms |
コンパイル使用メモリ | 65,920 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 07:33:21 |
合計ジャッジ時間 | 1,122 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream> #include<string> #include<sstream> using namespace std; int main() { string a,b; cin>>a>>b; bool flag=true; if((a[0]=='0'&&a!="0")||(b[0]=='0'&&b!="0"))flag=false; for(int i=0;i<a.size();i++) { if(a[i]<'0'||a[i]>'9')flag=false; } for(int i=0;i<b.size();i++) { if(b[i]<'0'||b[i]>'9')flag=false; } stringstream s1,s2; int ss1,ss2; s1<<a; s1>>ss1; s2<<b; s2>>ss2; if(ss1>12345||ss2>12345)flag=false; if(flag)cout<<"OK"<<endl; else cout<<"NG"<<endl; return 0; }