結果
問題 | No.2730 Two Types Luggage |
ユーザー |
|
提出日時 | 2024-04-19 21:27:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,030 ms / 2,000 ms |
コード長 | 784 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 267,628 KB |
最終ジャッジ日時 | 2024-10-11 13:59:35 |
合計ジャッジ時間 | 20,310 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random#sys.setrecursionlimit(10**9)#sys.set_int_max_str_digits(0)#input = sys.stdin.readline#n = int(input())##alist = []#s = input()n,m,w = map(int,input().split())alist = list(map(int,input().split()))blist = list(map(int,input().split()))clist = list(map(int,input().split()))ans = 0alist.sort(reverse=True)alist = list(itertools.accumulate(alist))for i in itertools.product([0,1],repeat=m):temp = 0we = 0for j in range(m):if i[j]:temp += clist[j]we += blist[j]res = w - weif res >= n:temp += alist[-1]elif res >= 1:temp += alist[res-1]if we <= w:ans = max(ans,temp)print(ans)