11763 | 2024-11-09 16:20:06 | balint | Sokszorozott maximumok | python3 | Time limit exceeded 11/100 | 2.095s | 27792 KiB |
from math import prod
def main():
MOD = 10**9 + 7
N, Q = map(int, input().split())
nums = list(map(int, input().split()))
for _ in range(Q):
L, R, k = map(int, input().split())
sub = nums[L : R + 1]
print(prod(sorted(sub, reverse=True)[:k]) % MOD)
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 3128 KiB | ||||
subtask2 | 11/11 | ||||||
2 | Accepted | 28ms | 3128 KiB | ||||
3 | Accepted | 29ms | 3112 KiB | ||||
4 | Accepted | 165ms | 3200 KiB | ||||
5 | Accepted | 490ms | 3444 KiB | ||||
6 | Accepted | 17ms | 3140 KiB | ||||
7 | Accepted | 108ms | 3232 KiB | ||||
subtask3 | 0/13 | ||||||
8 | Accepted | 27ms | 3320 KiB | ||||
9 | Accepted | 30ms | 3128 KiB | ||||
10 | Accepted | 238ms | 3268 KiB | ||||
11 | Time limit exceeded | 2.086s | 14592 KiB | ||||
12 | Time limit exceeded | 2.095s | 27572 KiB | ||||
13 | Time limit exceeded | 2.092s | 27752 KiB | ||||
subtask4 | 0/19 | ||||||
14 | Time limit exceeded | 2.072s | 22852 KiB | ||||
15 | Time limit exceeded | 2.072s | 25140 KiB | ||||
16 | Time limit exceeded | 2.069s | 27784 KiB | ||||
17 | Time limit exceeded | 2.072s | 27736 KiB | ||||
18 | Time limit exceeded | 2.084s | 27724 KiB | ||||
subtask5 | 0/25 | ||||||
19 | Time limit exceeded | 2.084s | 9412 KiB | ||||
20 | Time limit exceeded | 2.081s | 8700 KiB | ||||
21 | Time limit exceeded | 2.085s | 8712 KiB | ||||
22 | Time limit exceeded | 2.085s | 9236 KiB | ||||
23 | Time limit exceeded | 2.071s | 6280 KiB | ||||
subtask6 | 0/32 | ||||||
24 | Time limit exceeded | 2.073s | 27720 KiB | ||||
25 | Time limit exceeded | 2.073s | 27736 KiB | ||||
26 | Time limit exceeded | 2.075s | 22852 KiB | ||||
27 | Time limit exceeded | 2.073s | 25292 KiB | ||||
28 | Time limit exceeded | 2.088s | 27792 KiB | ||||
29 | Time limit exceeded | 2.088s | 27472 KiB | ||||
30 | Time limit exceeded | 2.088s | 25356 KiB |