結果

問題 No.949 飲酒プログラミングコンテスト
ユーザー seica_at_seseica_at_se
提出日時 2019-12-12 00:53:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 734 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 42,864 KB
最終ジャッジ日時 2023-09-06 13:39:25
合計ジャッジ時間 8,524 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 TLE -
testcase_12 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(input())
a = np.flipud(np.array(readline().split(),np.int32))
b = np.flipud(np.array(readline().split(),np.int32))
d = np.array(readline().split(),np.int32)
d.sort()

dp = np.zeros((3003, 3003), dtype=int)

for i in range(n+1):
    for j in range(n+1):
        #print(i, j)
        if i > 0:
            dp[i][j] = max(dp[i][j], dp[i-1][j])

        if j > 0:
            dp[i][j] = max(dp[i][j], dp[i][j-1])

        if dp[i][j] == n:
            continue
        if i == n and j == n:
            continue
        if a[i] + b[j] >= d[dp[i][j]]:
            dp[i][j] += 1

print(dp[n][n])
0