結果
| 問題 |
No.3014 岩井満足性問題
|
| コンテスト | |
| ユーザー |
prin_kemkem
|
| 提出日時 | 2025-01-25 15:06:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,175 bytes |
| コンパイル時間 | 4,161 ms |
| コンパイル使用メモリ | 81,936 KB |
| 実行使用メモリ | 264,184 KB |
| 最終ジャッジ日時 | 2025-01-25 23:41:38 |
| 合計ジャッジ時間 | 12,779 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 MLE * 2 |
ソースコード
from collections import defaultdict, deque, Counter
# from functools import cache
# import copy
from itertools import combinations, permutations, product, accumulate, groupby, chain
# from more_itertools import distinct_permutations
from heapq import heapify, heappop, heappush, heappushpop
import math
import bisect
# from pprint import pprint
from random import randint, shuffle, randrange
# from sortedcontainers import SortedSet, SortedList, SortedDict
import sys
# sys.setrecursionlimit(2000000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)
#################################################
import gc
N, D, K = map(int, input().split())
A = list(map(int, input().split()))
C = list(map(int, input().split()))
dp = [[-inf]*(K+1) for _ in range(D+1)]
dp[0][0] = 0
cnt = 0
for a, c in zip(A, C):
ndp = [x[:] for x in dp]
for i in range(D):
for j in range(K+1):
ndp[i+1][min(j+c, K)] = max(ndp[i+1][min(j+c, K)], dp[i][j]+a)
dp = ndp
# cnt = (cnt+1)%50
# if cnt == 0:
# gc.collect()
print(dp[D][K] if dp[D][K] != -inf else "No")
prin_kemkem