結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
|
提出日時 | 2020-06-22 13:39:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 607 bytes |
コンパイル時間 | 1,490 ms |
コンパイル使用メモリ | 168,504 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-03 18:39:40 |
合計ジャッジ時間 | 2,210 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ string a,b; cin>>a>>b; int ak=a.length(); int bk=b.length(); bool fA=true; for(int i=0; i<ak; i++){ if(isalpha(a[i])) fA=false; } bool fB=true; for(int i=0; i<bk; i++){ if(isalpha(b[i])) fB=false; } if(!(fA==true&&fB==true)) {cout << "NG" << endl; return 0;} if(ak>1&&a[0]=='0') fA=false; if(bk>1&&b[0]=='0') fB=false; int na, nb; na=stoi(a); nb=stoi(b); if(na>12345) fA=false; if(nb>12345) fB=false; if(!(fA==true&&fB==true)) cout << "NG" << endl; else cout << "OK" << endl; }