結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-11-18 22:35:07 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 621 bytes |
コンパイル時間 | 443 ms |
コンパイル使用メモリ | 57,788 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 07:18:07 |
合計ジャッジ時間 | 1,044 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include<iostream>using namespace std;bool Alp(string s){bool ret=false;for(int i=0; i<s.size(); i++){ret|=(('a'<=s[i]&&s[i]<='z')||('A'<=s[i]&&s[i]<='Z'));}return ret;}bool Zero(string s){if(s.size()==1) return false;if(s[0]=='0') return true;else return false;}int main(){string A, B;cin>> A>> B;if(Alp(A)||Alp(B)){cout<< "NG"<< endl;return 0;}if(Zero(A)||Zero(B)){cout<< "NG"<< endl;return 0;}if(stoi(A)<=12345&&stoi(B)<=12345){cout<< "OK"<< endl;}else{cout<< "NG"<< endl;}return 0;}