結果

問題 No.3065 Speedrun (Normal)
ユーザー ゼリトキ
提出日時 2025-03-21 21:29:46
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 3,050 ms
コンパイル使用メモリ 281,720 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-21 21:29:50
合計ジャッジ時間 3,712 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define INF 9e18;
int main(){
    cin.tie(0)->sync_with_stdio(0);
    cout.tie(0);
    vector<pair<int,int>>data(4);
    rep(i,4) cin>>data.at(i).second;
    rep(i,4) cin>>data.at(i).first;
    ll T;
    cin>>T;
    sort(data.begin(),data.end());
    ll ans=0;
    rep(i,4){
        if(data.at(i).first*data.at(i).second<=T){
            T-=data.at(i).first*data.at(i).second;
            ans+=data.at(i).second;
        }
        else{
            ans+=T/data.at(i).first;
            break;
        }
    }
    cout<<ans<<endl;
}
0