結果
問題 |
No.2922 Rose Garden
|
ユーザー |
|
提出日時 | 2024-10-12 16:31:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 985 bytes |
コンパイル時間 | 522 ms |
コンパイル使用メモリ | 62,976 KB |
実行使用メモリ | 14,592 KB |
最終ジャッジ日時 | 2024-10-12 16:31:24 |
合計ジャッジ時間 | 9,427 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 49 |
ソースコード
#include <iostream> using namespace std; // スタミナ1減らし 高度B上げ // 今の足場から隣に 高度が隣の足場の高さ未満の時無理 // 一回休憩してスタミナをS獲得 しかし高さはリセット int main(void){ // Your code here! long int n,s,b,currentHigh,ss = 0; cin >> n >> s >> b; ss = s; long int h[n],i = 0; for(int i = 0; i < n; i++)cin >> h[i]; currentHigh = h[0]; while(1); while(i != (n - 1)) { if(currentHigh >= h[i + 1]){ if(currentHigh == h[i]) ss = s; i++; continue; } if(ss > 0){ currentHigh += b; ss--; } else { currentHigh = h[i]; ss = s; if((s * b + h[i]) < h[i + 1]){ cout << "No"; return 0; } } } cout << "Yes"; }