結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2016-11-18 23:27:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 60,412 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 08:38:16 |
合計ジャッジ時間 | 999 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 10 WA * 3 |
ソースコード
#include<iostream> #include<cmath> using namespace std; int main(){ string A,B; cin>>A>>B; bool ng=(A.length()<=5)&&(B.length()<=5)||!(A.length()>1&&A[0]=='0')||!(B.length()>1&&B[0]=='0'); int inta=0,intb=0; for(int i=0; i<A.length(); i++){ if(A[i]<'0'||A[i]>'9')ng=false; inta+=(A[i]-'0')*pow(10,i); } for(int i=0; i<B.length(); i++){ if(B[i]<'0'||B[i]>'9')ng=false; intb+=(B[i]-'0')*pow(10,i); } cout<<((ng&&inta<=12345&&intb<=12345)?("OK"):("NG"))<<endl; return 0; }