General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
153806087 Practice:
DavidVictor2004
1665B - 38 PyPy 3 Time limit exceeded on test 16 1000 ms 15748 KB 2022-04-16 15:08:47 2022-04-16 15:08:47
→ 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