結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
|
提出日時 | 2018-06-17 21:36:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 547 bytes |
コンパイル時間 | 503 ms |
コンパイル使用メモリ | 65,252 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 16:36:12 |
合計ジャッジ時間 | 1,267 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 WA * 3 |
ソースコード
#include <iostream> #include <string> using namespace std; bool NotDigit(string S){ for (int i=0;i<S.length();i++){ if (S[i]<'0' || S[i]>'9'){ return true; } } return false; } int main(int argc, char* argv[]) { string A,B; cin>>A; cin>>B; if (NotDigit(A) || NotDigit(B)){ cout<<"NG"<<endl; return 0; } int a1=atol(A.c_str()); int b1=atol(A.c_str()); if (a1>12345 || b1>12345){ cout<<"NG"<<endl; return 0; } if (a1>0 && A[0]=='0' || b1>0 && B[0]=='0'){ cout<<"NG"<<endl; return 0; } cout<<"OK"<<endl; return 0; }