結果
| 問題 |
No.1043 直列大学
|
| コンテスト | |
| ユーザー |
nehan_der_thal
|
| 提出日時 | 2020-05-01 22:48:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 708 bytes |
| コンパイル時間 | 282 ms |
| コンパイル使用メモリ | 12,928 KB |
| 実行使用メモリ | 36,480 KB |
| 最終ジャッジ日時 | 2024-12-25 13:45:01 |
| 合計ジャッジ時間 | 40,393 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 TLE * 11 |
ソースコード
import sys;input=sys.stdin.readline
N, M = map(int, input().split())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
A, B = map(int, input().split())
sx = sum(X)+1
sy = sum(Y)+1
V = [0]*sx
V[0] = 1
for i in range(N):
x = X[i]
for j in range(sx-1, -1, -1):
if j-x>=0:
V[j] += V[j-x]
R = [0]*sy
R[0] = 1
for i in range(M):
x = Y[i]
for j in range(sy-1, -1, -1):
if j-x>=0:
R[j] += R[j-x]
SV = [0]*(sx+1)
for i in range(1, sx+1):
SV[i] = SV[i-1] + V[i-1]
mod = 1000000007
rr = 0
for i in range(1, sy):
r = R[i]
a, b = min(i*A, sx), min(i*B+1, sx)
rr = (rr+(SV[b]-SV[a])*r) % mod
#print(SV)
#print(V, R)
print(rr)
nehan_der_thal