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