結果
| 問題 |
No.2056 非力なレッド
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2022-08-26 21:58:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 620 bytes |
| コンパイル時間 | 2,020 ms |
| コンパイル使用メモリ | 195,532 KB |
| 最終ジャッジ日時 | 2025-01-31 04:48:24 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n,x,m;
cin>>n>>x>>m;
vector<int> A(n);
rep(i,n) cin>>A[i];
vector<int> B(n);
rep(i,n){
int t=A[i];
int cnt=0;
while(t>=x){
cnt++;
t/=2;
}
B[i]=cnt;
}
ll sum=0;
int now=0;
for(int i=n-1;i>=0;i--){
if(B[i]>now){
sum+=(B[i]-now)*(i+1);
now=B[i];
}
}
if(sum<=m) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}
umezo