結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2017-02-16 05:15:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 460 bytes |
コンパイル時間 | 1,873 ms |
コンパイル使用メモリ | 166,664 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 00:11:01 |
合計ジャッジ時間 | 2,494 ms |
ジャッジサーバーID (参考情報) |
judge2 / 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++) struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; bool check( string S ) { if( S[ 0 ] == '0' && S.size() > 1 ) return false; REP( i, (int)S.size() ) { if( isalpha( S[ i ] ) ) return false; } int N = stoi( S ); return N <= 12345; } int main() { string A, B; cin >> A >> B; cout << ( check( A ) && check( B ) ? "OK" : "NG" ) << endl; return 0; }