結果

問題 No.512 魔法少女の追いかけっこ
ユーザー a01sa01to
提出日時 2024-08-30 00:17:37
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 3,070 ms
コンパイル使用メモリ 246,716 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-30 00:17:42
合計ジャッジ時間 4,969 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  int x, y, n;
  cin >> x >> y >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> sum(n + 1, 0);
  rep(i, n) sum[i + 1] = sum[i] + a[i];
  rep(i, n) {
    if (y * sum[i] > sum[i + 1] * x) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
0