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 1263. Elections

Show all messages Hide all messages

m = []
g = []
d, b = map(int, input().split(' '))
for i in range(1, b+1):
    n = int(input())
    m.append(n)
for i in range(1, d+1):
    g.append(i)
for i in range(d):
    f = 0
    for y in range(b):
        if m[y] == g[i]:
            f += 1/b*100
    f = round(f, 2)
    a = str(f)
    if len(a) == 4:
        print(a+'0%')
    else:
        print(a+'%')
при 100% проголосовавших выводится 100.0%.

Edited by author 30.12.2018 18:16
Попробуй вариант где ответ - 100%