結果
問題 |
No.2056 非力なレッド
|
ユーザー |
![]() |
提出日時 | 2025-03-29 05:25:08 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 674 bytes |
コンパイル時間 | 3,546 ms |
コンパイル使用メモリ | 277,872 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-29 05:25:14 |
合計ジャッジ時間 | 5,804 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <bits/stdc++.h> //#include <atcoder/modint> using namespace std; //using namespace atcoder; using ll = long long; //using mint = modint998244353; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N, X, M, A, ans=0; cin >> N >> X >> M; vector<ll> c(N); for (int i=0; i<N; i++){ cin >> A; while(A >= X){ A /= 2; c[i]++; } } for (int i=N-2; i>=0; i--) c[i] = max(c[i], c[i+1]); c.push_back(0); for (int i=N-1; i>=0; i--){ ans += (c[i]-c[i+1]) * (i+1); } if (ans <= M) cout << "Yes" << endl; else cout << "No" << endl; return 0; }