11554 | 2024-10-26 18:39:00 | balint | Pontos átlag 2 | python3 | Time limit exceeded 0/100 | 2.099s | 27004 KiB |
def main():
N, K = map(int, input().strip().split())
nums = list(map(int, input().strip().split()))
c = 1
current_sum = sum(nums)
to_sum = K*N
adding = to_sum > current_sum
if adding:
while True:
current_sum += N
if current_sum >= to_sum:
break
c+=1
else:
while True:
if c in nums:
N -= 1
current_sum -= N
if current_sum <= to_sum:
break
c+=1
print(c)
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3128 KiB | ||||
2 | Accepted | 17ms | 2872 KiB | ||||
subtask2 | 0/10 | ||||||
3 | Accepted | 16ms | 3144 KiB | ||||
4 | Accepted | 17ms | 3124 KiB | ||||
5 | Time limit exceeded | 2.084s | 2864 KiB | ||||
6 | Time limit exceeded | 2.084s | 2872 KiB | ||||
7 | Wrong answer | 16ms | 2980 KiB | ||||
8 | Time limit exceeded | 2.099s | 2980 KiB | ||||
subtask3 | 0/20 | ||||||
9 | Accepted | 50ms | 7364 KiB | ||||
10 | Wrong answer | 48ms | 6668 KiB | ||||
11 | Wrong answer | 46ms | 6720 KiB | ||||
12 | Accepted | 46ms | 6716 KiB | ||||
13 | Accepted | 50ms | 7372 KiB | ||||
14 | Accepted | 50ms | 6644 KiB | ||||
15 | Wrong answer | 48ms | 6684 KiB | ||||
16 | Wrong answer | 48ms | 6600 KiB | ||||
17 | Accepted | 16ms | 3128 KiB | ||||
subtask4 | 0/24 | ||||||
18 | Time limit exceeded | 2.098s | 3124 KiB | ||||
19 | Time limit exceeded | 2.099s | 3028 KiB | ||||
20 | Time limit exceeded | 2.099s | 3108 KiB | ||||
21 | Wrong answer | 119ms | 3128 KiB | ||||
22 | Time limit exceeded | 2.085s | 3128 KiB | ||||
23 | Accepted | 456ms | 3216 KiB | ||||
24 | Time limit exceeded | 2.071s | 3132 KiB | ||||
25 | Wrong answer | 17ms | 3208 KiB | ||||
26 | Time limit exceeded | 2.099s | 3092 KiB | ||||
27 | Wrong answer | 46ms | 3132 KiB | ||||
28 | Accepted | 14ms | 2924 KiB | ||||
subtask5 | 0/46 | ||||||
29 | Wrong answer | 50ms | 6656 KiB | ||||
30 | Wrong answer | 291ms | 27004 KiB | ||||
31 | Time limit exceeded | 2.071s | 16792 KiB | ||||
32 | Accepted | 693ms | 22268 KiB | ||||
33 | Time limit exceeded | 2.082s | 26284 KiB | ||||
34 | Time limit exceeded | 2.088s | 26268 KiB | ||||
35 | Wrong answer | 81ms | 26896 KiB | ||||
36 | Time limit exceeded | 2.088s | 26836 KiB | ||||
37 | Time limit exceeded | 2.072s | 26888 KiB | ||||
38 | Time limit exceeded | 2.078s | 26168 KiB | ||||
39 | Time limit exceeded | 2.085s | 11224 KiB | ||||
40 | Wrong answer | 1.131s | 3688 KiB | ||||
41 | Accepted | 16ms | 3128 KiB |