Skip to content

Commit a94d361

Browse files
authored
d1000000 Solution
1 parent 2a4166c commit a94d361

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

d1000000.py3

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
def doit():
2+
n = int(input())
3+
dices = [int(x) for x in input().split()]
4+
maxNum = max(dices)
5+
memo = [0] * (maxNum+1)
6+
for i in range(n):
7+
memo[dices[i]] += 1
8+
result = 0
9+
left = 0
10+
for i in range(maxNum, 0, -1):
11+
left += memo[i]
12+
if left > 0:
13+
left -= 1
14+
result += 1
15+
return result
16+
17+
T = int(input())
18+
for t in range(1, T + 1):
19+
print('Case #{}: {}'.format(t, doit()))

0 commit comments

Comments
 (0)