結果

問題 No.23 技の選択
コンテスト
ユーザー goodbaton
提出日時 2015-07-29 19:01:41
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 418µs
コード長 811 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 369 ms
コンパイル使用メモリ 95,544 KB
実行使用メモリ 9,876 KB
最終ジャッジ日時 2026-10-10 14:23:47
合計ジャッジ時間 2,133 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstring>

typedef long long ll;
using namespace std;

#define mod 1000003
#define INF 1000000000
#define LLINF 2000000000000000000LL

#define SIZE 10000

int main(){
    int h,a,d;
    int dp[SIZE*2+1],ans=INF;
    
    for(int i=0;i<=SIZE*2;i++) dp[i] = INF;
    
    dp[0] = 0;
    
    scanf("%d%d%d",&h,&a,&d);
    
    for(int i=0;i<h;i++){
        dp[i+a] = min(dp[i+a],dp[i]+2);
        dp[i+d] = min(dp[i+d],dp[i]+3);
        
        if(i+a>=h)
            ans = min(ans,dp[i+a]);
        if(i+d>=h)
            ans = min(ans,dp[i+d]);
    }
    
    printf("%.2lf",ans/2.0);
    
    return 0;
}
0