General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
153414972 Practice:
LumosMaxima
1665B - 35 PyPy 3 Accepted 577 ms 15964 KB 2022-04-12 00:45:36 2022-04-12 00:45:36
 
 
→ Source
from math import ceil, log2
from collections import Counter as c
for t in range(int(input())):
    n = int(input())
    u = list(map(int, input().split()))
    acc = c(u).most_common(1)[0][1]
    if(acc == n):
        print(0)
        continue
    op = ceil(log2(n/acc)) + (n - acc)
    print(op)
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details