結果

問題 No.1043 直列大学
ユーザー NagisaNagisa
提出日時 2020-05-01 22:54:51
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 575 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 114,244 KB
最終ジャッジ日時 2023-08-26 15:36:56
合計ジャッジ時間 6,972 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
77,464 KB
testcase_01 AC 70 ms
77,464 KB
testcase_02 AC 76 ms
77,436 KB
testcase_03 AC 69 ms
77,408 KB
testcase_04 AC 69 ms
77,372 KB
testcase_05 AC 69 ms
77,424 KB
testcase_06 AC 72 ms
77,640 KB
testcase_07 AC 70 ms
77,644 KB
testcase_08 AC 71 ms
77,536 KB
testcase_09 AC 105 ms
77,772 KB
testcase_10 AC 115 ms
77,852 KB
testcase_11 RE -
testcase_12 AC 330 ms
114,244 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 135 ms
83,992 KB
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 AC 102 ms
77,872 KB
testcase_28 AC 155 ms
79,312 KB
testcase_29 AC 84 ms
77,544 KB
testcase_30 AC 171 ms
83,848 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
S = sum(V)

D = [0]*(10**5+2)
for e in V:
    for k in range(10**5+1,-1,-1):
        if D[k] > 0:
            D[k+e] += D[k]
    D[e] += 1

T = [0]*(10**5+2)
for e in R:
    for k in range(10**5+1,-1,-1):
        if T[k] > 0:
            T[k+e] += T[k]
    T[e] += 1

for k in range(1,10**5+1):
    D[k] += D[k-1]
ans = 0

for k in range(1,sum(R)+1):
    ans += T[k]*(D[min(S,k*B)]-D[max(0,k*A-1)])
    ans %= MOD
print(ans)
0