結果

問題 No.1043 直列大学
ユーザー pekempeypekempey
提出日時 2020-05-01 21:48:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 634 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 10,976 KB
実行使用メモリ 32,056 KB
最終ジャッジ日時 2023-08-26 09:09:56
合計ジャッジ時間 13,703 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 249 ms
31,624 KB
testcase_01 AC 250 ms
31,732 KB
testcase_02 AC 264 ms
31,584 KB
testcase_03 AC 250 ms
31,744 KB
testcase_04 AC 247 ms
31,712 KB
testcase_05 AC 246 ms
31,768 KB
testcase_06 AC 253 ms
31,684 KB
testcase_07 AC 253 ms
31,672 KB
testcase_08 AC 250 ms
31,740 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 511 ms
31,712 KB
testcase_12 WA -
testcase_13 RE -
testcase_14 AC 478 ms
31,672 KB
testcase_15 RE -
testcase_16 AC 498 ms
31,764 KB
testcase_17 AC 411 ms
31,756 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 533 ms
31,768 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 324 ms
31,636 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def input_int():
    return int(input())

def input_ints():
    return list(map(int, input().split()))

import numpy as np

MOD = 10**9 + 7

N, M = input_ints()
V = input_ints()
R = input_ints()
A, B = input_ints()

dp = np.zeros(10**5 + 1, dtype=np.int64)
dp[0] = 1
for i in range(N):
    dp[V[i]:] += dp[:-V[i]]
    dp %= MOD

ep = np.zeros(10**5 + 1, dtype=np.int64)
ep[0] = 1
for i in range(N):
    ep[R[i]:] += ep[:-R[i]]
    ep %= MOD

ep = np.cumsum(ep)

ans = 0
for i in range(len(dp)):
    # i/B <= j <= i/A
    ans += dp[i] * ep[i // A]
    if i > 0:
        ans -= dp[i] * ep[(i + B - 1) // B - 1]
ans -= 1
print(ans % MOD)
0