ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1025. Democracy in Danger

Wrong answer! Test 5 is failed. Python
Posted by Quietude 15 Sep 2018 20:51
n = int(input())

l = list(map(int, input().split()))
l1 = []

for i in range(n):
    l1.append((l[i]//2 +1))

if n > 3:
    k = (n // 2 + 1) // 2 + 1 #Groups which decline
else:
    k = (n // 2 + 1) // 2

for i in range(k):
    l1.remove(max(l1))

print(sum(l1))


Edited by author 15.09.2018 21:04
Re: Wrong answer! Test 5 is failed. Python
Posted by Anatoly ~xapdkop~ Pitikin 20 Sep 2018 00:29
Just simplify ur code. This is very easy task. Bellow there is my ac solution:
[code deleted]

Edited by moderator 20.11.2019 00:09