結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー |
![]() |
提出日時 | 2016-11-18 23:05:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 938 bytes |
コンパイル時間 | 580 ms |
コンパイル使用メモリ | 69,368 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 07:55:09 |
合計ジャッジ時間 | 1,262 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>#include <string>#include <cctype>int main() {std::string a, b;std::cin >> a >> b;if ((a.length() > 1 && a[0] == '0') || (b.length() > 1 && b[0] == '0')) {std::cout << "NG" << std::endl;return 0;}for (int i = 0; i < a.length(); i++) {if (!isdigit(a[i])) {std::cout << "NG" << std::endl;return 0;}}for (int i = 0; i < b.length(); i++) {if (!isdigit(b[i])) {std::cout << "NG" << std::endl;return 0;}}if (a.length() == 5) {if (a > "12345") {std::cout << "NG" << std::endl;return 0;}}if (b.length() == 5) {if (b > "12345") {std::cout << "NG" << std::endl;return 0;}}std::cout << "OK" << std::endl;return 0;}