結果
問題 | No.1043 直列大学 |
ユーザー | Nagisa |
提出日時 | 2020-05-01 23:00:11 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 567 bytes |
コンパイル時間 | 111 ms |
コンパイル使用メモリ | 10,920 KB |
実行使用メモリ | 20,344 KB |
最終ジャッジ日時 | 2023-08-26 15:40:06 |
合計ジャッジ時間 | 5,230 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
7,840 KB |
testcase_01 | AC | 14 ms
7,812 KB |
testcase_02 | AC | 15 ms
7,816 KB |
testcase_03 | AC | 15 ms
7,820 KB |
testcase_04 | AC | 14 ms
7,864 KB |
testcase_05 | AC | 14 ms
7,848 KB |
testcase_06 | AC | 14 ms
7,784 KB |
testcase_07 | AC | 15 ms
7,732 KB |
testcase_08 | AC | 14 ms
7,732 KB |
testcase_09 | AC | 67 ms
8,444 KB |
testcase_10 | AC | 154 ms
8,804 KB |
testcase_11 | AC | 729 ms
10,372 KB |
testcase_12 | TLE | - |
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 | -- | - |
ソースコード
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]*(S+2) for e in V: for k in range(S+1,-1,-1): if D[k] > 0: D[k+e] += D[k] D[e] += 1 U = sum(R) T = [0]*(U+2) for e in R: for k in range(U+1,-1,-1): if T[k] > 0: T[k+e] += T[k] T[e] += 1 for k in range(1,S+2): D[k] += D[k-1] ans = 0 for k in range(1,U+1): ans += T[k]*(D[min(S,k*B)]-D[max(0,min(S,k*A-1))]) ans %= MOD print(ans)