結果

問題 No.1043 直列大学
ユーザー NagisaNagisa
提出日時 2020-05-01 22:49:42
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 570 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 86,860 KB
実行使用メモリ 112,332 KB
最終ジャッジ日時 2023-08-26 15:32:08
合計ジャッジ時間 7,503 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,224 KB
testcase_01 AC 73 ms
71,320 KB
testcase_02 AC 74 ms
71,400 KB
testcase_03 AC 75 ms
70,960 KB
testcase_04 AC 74 ms
71,312 KB
testcase_05 AC 74 ms
71,248 KB
testcase_06 AC 74 ms
71,084 KB
testcase_07 AC 75 ms
71,092 KB
testcase_08 RE -
testcase_09 AC 95 ms
76,216 KB
testcase_10 AC 104 ms
77,056 KB
testcase_11 RE -
testcase_12 AC 393 ms
112,332 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 116 ms
77,220 KB
testcase_29 AC 85 ms
76,072 KB
testcase_30 AC 171 ms
83,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int,input().split())
V = list(map(int,input().split()))
R = list(map(int,input().split()))
A, B = map(int,input().split())
MOD = 10**9 + 7
D = [0]*(sum(V)+2)
for e in V:
    for k in range(sum(V)+1,-1,-1):
        if D[k] > 0:
            D[k+e] += D[k]
    D[e] += 1
T = [0]*(sum(R)+2)
for e in R:
    for k in range(sum(R)+1,-1,-1):
        if T[k] > 0:
            T[k+e] += T[k]
    T[e] += 1
for k in range(1,sum(V)+2):
    D[k] += D[k-1]
ans = 0
for k in range(1,sum(R)+1):
    ans += T[k]*(D[min(sum(V),k*B)]-D[max(0,k*A-1)])
    ans %= MOD
print(ans)
0