結果

問題 No.2730 Two Types Luggage
ユーザー 乾麺乾麺
提出日時 2024-04-20 07:42:59
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 858 bytes
コンパイル時間 5,416 ms
コンパイル使用メモリ 338,148 KB
実行使用メモリ 25,652 KB
最終ジャッジ日時 2024-04-20 07:43:16
合計ジャッジ時間 15,176 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
13,884 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 8 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 3 ms
6,944 KB
testcase_10 AC 81 ms
6,940 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using si =vector<char>;
using ssi =vector<si>;
//using mint = modint998244353;
const long long INF = 1e18;
ll MIN(ll a,ll b){
if(a>b)return b;
else return a;
	
}

int main() { ll N,M,W;
cin>>N>>M>>W;
vector<ll>A(N),B(M),C(M);
rep(i,0,N)cin>>A[i];
rep(i,0,M)cin>>B[i];
rep(i,0,M)cin>>C[i];
vector<ll>SUM(N+1);
sort(A.begin(),A.end(),greater<ll>());
rep(i,0,N)SUM[i+1]+=SUM[i]+A[i];
ll ans=0;
for(ll bit=0;bit<(1<<M);bit++){ll sum=0;ll pr=0;
	rep(i,0,M){if(bit&(1<<i)){sum+=B[i];pr+=C[i];}}
	if(sum>W)continue;
		ans=max(ans,pr+SUM[MIN(W-sum,N)]);
	}
	cout<<ans;
}

0