結果
問題 | No.2056 非力なレッド |
ユーザー | 沙耶花 |
提出日時 | 2022-08-26 21:22:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 96 ms / 2,000 ms |
コード長 | 574 bytes |
コンパイル時間 | 4,215 ms |
コンパイル使用メモリ | 251,072 KB |
最終ジャッジ日時 | 2025-01-31 04:08:49 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main() { int N; long long X,M; cin>>N>>X>>M; vector<long long> need(N); rep(i,N){ long long a; cin>>a; while(a >= X){ a/=2; need[i] ++; } } for(int i=N-2;i>=0;i--)need[i] = max(need[i],need[i+1]); rep(i,N){ M -= need[i]; } if(M<0)cout<<"No"<<endl; else cout<<"Yes"<<endl; return 0; }