結果
問題 |
No.3014 岩井満足性問題
|
ユーザー |
|
提出日時 | 2025-01-25 13:19:48 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 967 bytes |
コンパイル時間 | 212 ms |
コンパイル使用メモリ | 82,584 KB |
実行使用メモリ | 272,204 KB |
最終ジャッジ日時 | 2025-01-25 22:43:27 |
合計ジャッジ時間 | 15,303 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge7 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 TLE * 2 |
ソースコード
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,d,k = map(int,input().split()) #for i in range(n): # alist.append(list(map(int,input().split()))) a = list(map(int,input().split())) c = list(map(int,input().split())) dd = c[:] dd.sort(reverse=True) if sum(dd[:d]) < k: exit(print('No')) dp = [[-10**18 for i in range(k+1)] for j in range(d+1)] dp[0][0] = 0 #print(d,k) for i in range(n): ndp = [[-10**18 for efvjnfe in range(k+1)] for rfunrfu in range(d+1)] for j in range(d+1): for l in range(k+1): ndp[j][l] = max(ndp[j][l],dp[j][l]) if j+1 <= d: #rint(i,j,l,dp[j][l] + a[i]) ndp[j+1][min(k,l+c[i])] = max(ndp[j+1][min(k,l+c[i])],dp[j][l] + a[i]) #print(ndp[1][3],a,c) dp = ndp print(dp[d][k])