結果
| 問題 | No.2056 非力なレッド |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-08 10:47:02 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 2,000 ms |
| + 669µs | |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 2,513 ms |
| コンパイル使用メモリ | 168,964 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-08 10:47:11 |
| 合計ジャッジ時間 | 7,582 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
#include<iostream>
#include<vector>
using namespace std;
using ll = long long;
int main(void){
ll n, x, m; cin >> n >> x >> m;
vector<ll> a(n);
for(auto&y:a) cin >> y;
int c=0;
ll cost=0;
for(int t=n; t>=1; t--){
int i=t-1, now=0;
while(a[i]>=x){
now++, a[i]/=2;
}
ll add=max(0, now-c);
cost+=add*t;
c=max(c, now);
}
cout << (cost<=m?"Yes":"No") << endl;
return 0;
}