結果
| 問題 | No.446 ゆきこーだーの雨と雪 (1) |
| コンテスト | |
| ユーザー |
hiragn
|
| 提出日時 | 2019-07-19 03:53:13 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 527 bytes |
| 記録 | |
| コンパイル時間 | 1,005 ms |
| コンパイル使用メモリ | 180,948 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-31 16:51:17 |
| 合計ジャッジ時間 | 2,114 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
bool solve(string s) {
//リーディングゼロ
if (s.length() != 1 and s[0] == '0') {
return false;
}
//数字以外
for (char i : s) {
if (i < '0' or i > '9') {
return false;
}
}
//最大値
return (stoi(s) <= 12345);
}
int main() {
string s1, s2;
cin >> s1 >> s2;
if (solve(s1) and solve(s2)) {
cout << "OK" << endl;
} else {
cout << "NG" << endl;
}
return 0;
}
hiragn