結果

問題 No.3065 Speedrun (Normal)
ユーザー とんぼ
提出日時 2025-03-21 21:40:27
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 3,115 ms
コンパイル使用メモリ 276,620 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-21 21:40:32
合計ジャッジ時間 3,782 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(i=0;i<N;i++)
#define ll long long

typedef struct _quest{
    ll num;
    ll t;
}quest;

bool comp_num(quest a,quest b){
    return a.num<b.num;
}

bool comp_t(quest a,quest b){
    return a.t<b.t;
}

int main(void){
    ll N;
    quest Q[4];
    ll T;

    ll i,j,k;

    rep(i,4)cin>>Q[i].num;
    rep(i,4)cin>>Q[i].t;
    cin>>T;

    sort(Q,Q+4,comp_t);

    ll ans=0;
    rep(i,4){
        ll sol=min(T/Q[i].t,Q[i].num);
        T-=sol*Q[i].t;
        ans+=sol;
    }

    cout<<ans<<endl;

    return 0;
}
0