結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
|
提出日時 | 2020-04-03 03:58:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 2,042 ms |
コンパイル使用メモリ | 192,512 KB |
最終ジャッジ日時 | 2025-01-09 12:38:33 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; bool check(string s){ if(s.length()>5) return false; rep(i,s.length()) if(!isdigit(s[i])) return false; if(s.length()>1 && s[0]=='0') return false; return stoi(s)<=12345; } int main(){ string a,b; cin>>a>>b; puts(check(a)&&check(b)?"OK":"NG"); return 0; }