98462024-03-11 20:48:21birozsMaximális szorzat (50 pont)python3Wrong answer 0/50310ms37540 KiB
N,K,b = map(int,input().split())
lista = list(map(int,input().split()))
lista.sort()
print(lista)
n = len(lista)
szorzat = 1
for i in range(b):
    szorzat = (szorzat * lista[i]) % (10**9+7)
print(szorzat)
while K > 0:
    j = b
    elso = lista[b]
    while j < n and lista[j] == elso and K > 0:
        lista[j] += 1
        K = K - 1
        j += 1
print(lista)
for i in range(b,n):
    szorzat = (szorzat * lista[i]) % (10**9+7)
if szorzat >= 0:
    print(szorzat)
else:
    print(-1)

        

SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/017ms11284 KiB
2Wrong answer0/017ms11436 KiB
3Wrong answer0/017ms11800 KiB
4Wrong answer0/017ms11916 KiB
5Wrong answer0/032ms14168 KiB
6Wrong answer0/217ms11768 KiB
7Wrong answer0/218ms12316 KiB
8Wrong answer0/217ms12240 KiB
9Wrong answer0/218ms13040 KiB
10Wrong answer0/241ms15524 KiB
11Wrong answer0/2256ms35092 KiB
12Wrong answer0/1273ms35452 KiB
13Wrong answer0/137ms13680 KiB
14Wrong answer0/154ms15872 KiB
15Wrong answer0/1178ms25988 KiB
16Wrong answer0/1190ms25364 KiB
17Wrong answer0/1181ms25304 KiB
18Wrong answer0/143ms15424 KiB
19Runtime error0/1136ms36688 KiB
20Runtime error0/1123ms36084 KiB
21Runtime error0/1136ms35420 KiB
22Runtime error0/182ms30204 KiB
23Wrong answer0/1266ms36116 KiB
24Wrong answer0/1264ms36000 KiB
25Wrong answer0/234ms14244 KiB
26Wrong answer0/235ms16740 KiB
27Runtime error0/275ms26484 KiB
28Runtime error0/175ms26516 KiB
29Wrong answer0/2196ms26324 KiB
30Wrong answer0/1303ms36532 KiB
31Wrong answer0/1128ms37540 KiB
32Wrong answer0/2168ms14612 KiB
33Wrong answer0/2286ms36800 KiB
34Wrong answer0/1287ms36584 KiB
35Wrong answer0/2298ms37056 KiB
36Wrong answer0/2310ms37072 KiB
37Wrong answer0/2310ms37052 KiB
38Wrong answer0/2294ms36864 KiB
39Wrong answer0/1157ms14568 KiB