結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー kyo1
提出日時 2020-09-15 09:30:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 1,838 ms
コンパイル使用メモリ 194,688 KB
最終ジャッジ日時 2025-01-14 14:57:52
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string A, B;
  cin >> A >> B;
  function check = [](string s) {
    for (int i = 0; i < (int)s.size(); i++) {
      if (!('0' <= s[i] && s[i] <= '5')) return false;
    }
    int x = stoi(s);
    return x <= 12345 && !((int)s.size() > 1 && s[0] == '0');
  };
  if (check(A) && check(B)) {
    cout << "OK" << '\n';
  } else {
    cout << "NG" << '\n';
  }
  return 0;
}
0