結果

問題 No.2450 99-like Number
ユーザー yosakayosaka
提出日時 2023-09-02 14:50:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,994 bytes
コンパイル時間 1,704 ms
コンパイル使用メモリ 177,760 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 14:50:13
合計ジャッジ時間 2,913 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <ostream>
#include <vector>
using namespace std;
// #define l long
#define ul unsigned long
#define ll long long
#define ull unsigned long long
#define rep(i, v, n) for (int i = v; i < n; ++i)
#define rrep(i, v, n) for (int i = v; i > n; --i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()

template <typename T> T modpow(T x, T y, T M) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return modpow(x, y / 2, M) * modpow(x, y / 2, M) % M;
  else
    return modpow(x, y - 1, M) * x % M;
}

template <typename T> T gcd(T a, T b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}

bool compare_by_s(pair<int, int> a, pair<int, int> b) {
  return a.second < b.second;
}

bool compare_by_f(pair<int, int> a, pair<int, int> b) {
  return a.first < b.first;
}

bool rcompare_by_s(pair<int, int> a, pair<int, int> b) {
  return a.second > b.second;
}

bool rcompare_by_f(pair<int, int> a, pair<int, int> b) {
  return a.first > b.first;
}

bool compare_vec(vector<int> &a, vector<int> &b) { return a[0] < b[0]; }

template <typename T>
bool next_combination(const T first, const T last, int k) {
  const T subset = first + k;
  // empty container | k = 0 | k == n
  if (first == last || first == subset || last == subset) {
    return false;
  }
  T src = subset;
  while (first != src) {
    src--;
    if (*src < *(last - 1)) {
      T dest = subset;
      while (*src >= *dest) {
        dest++;
      }
      iter_swap(src, dest);
      rotate(src + 1, dest + 1, last);
      rotate(subset, subset + (last - dest) - 1, last);
      return true;
    }
  }
  // restore
  rotate(first, subset, last);
  return false;
}

template <typename T> bool is_prime(const T V) {
  rep(i, 2, sqrt((double)V) + 1) {
    if (V % i == 0)
      return false;
  }
  return true;
}

map<long, int> make_primes(long N) {
  map<long, int> primes;
  rep(i, 0, sqrt((double)N) + 1) {
    if (N % i == 0) {
      primes[i] = 0;
      while (N % i == 0) {
        primes[i]++;
        N /= i;
      }
    }
  }
  if (N > 1) {
    primes[N] = 1;
  }
  return primes;
}
template <typename T> void printmat(vector<vector<T>> mat) {
  for (int i = 0; i < mat.size(); ++i) {
    for (int j = 0; j < mat[i].size(); ++j) {
      cout << mat[i][j] << " ";
    }
    cout << endl;
  }
}
template <typename T> void printvec(vector<T> vec) {
  rep(i, 0, vec.size()) cout << vec[i] << " ";
  cout << endl;
}

set<ll> make_primes(ll N) {
  set<ll> ret;
  for (ll i = 2; i < sqrt(N) + 1; ++i) {
    if (is_prime(i)) {
      ret.insert(i);
    }
  }
  return ret;
}

bool is_ok(long mid, vector<long> &A, long K) {

  long cnt = 0;
  rep(i, 0, A.size()) { cnt += mid / A[i]; }
  return cnt >= K;
}

int main(void) {
  string N;
  cin >> N;
  for (int i = 0; i < N.length(); ++i) {
    if (N[i] != '9') {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
0