結果
| 問題 |
No.23 技の選択
|
| コンテスト | |
| ユーザー |
ramia777
|
| 提出日時 | 2022-05-25 23:06:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,229 bytes |
| コンパイル時間 | 692 ms |
| コンパイル使用メモリ | 90,604 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-20 14:50:13 |
| 合計ジャッジ時間 | 1,914 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
//Yukicoder
//Q23 Select of technique
//二次元可変配列
//vector <vector <int>> mass;
//vector <vector <int>> memo;
//#include "stdafx.h"
#include <iostream>
#include <vector>
#include <list>//list
#include <set> //tree
#include <map> //連想配列
#include <unordered_set> //hash
#include <unordered_map> //hash
#include <algorithm>
#include <iomanip>
using namespace std;
typedef unsigned long long ULL;
typedef signed long long SLL;
#define START (0)
#define RIGHT (1)
#define UP (2)
#define LEFT (3)
#define DOWN (4)
#define DATA_MAX (1000000)
#define FMAX(a,b) ((a)>(b)?(a):(b))
#define FMIN(a,b) ((a)<(b)?(a):(b))
#define FCEIL(a,b) ((a)+(b)-1)/(b)
float N, D, H ,A;
int ans = 0;
float dp[10005];
int main()
{
cin >> H;
cin >> A;
cin >> D;
//通常攻撃で敵を倒すのに必要な回数
int n = FCEIL(H , A);
//cout << n << endl;
dp[0] = n; //全部通常攻撃
int i;
for (i= 1;i<=n;i++)
{
float a;
float h;
h = H - A * (n-i);
a = FCEIL((int)h , (int)D) * 1.5f; //必殺技で必要な回数
dp[i] = FMIN(dp[i - 1], (float)(a+(n-i)));
//cout << "通常攻撃=" << n-i << ",必殺技=" << a << endl;
}
cout << dp[n] << endl;
return 0; //end
}
ramia777