/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Time Exceeded ≥985ms ≥3.461 MiB

Code

for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))
    k = int(input())
    def ctdv(num):
        c = 0
        for i in range(1,n+1):
            if num % i == 0:
                c += 1
        return c 
    
    def srt_by_d_v(x):
        return (ctdv(x), -x) 
    
    
    sort_arr = sorted(l , key = srt_by_d_v)  #key hishebe 2 ta jinish nibe, age count then -value,borota age ashbe karon -borota list a age dibe
    
    #print(sort_arr)
    print(sort_arr[k-1])

Information

Submit By
Type
Submission
Problem
P1008 Ordering Number
Language
Python 3 (Python 3.12.3)
Submit At
2024-01-08 18:25:39
Judged At
2024-01-08 18:25:39
Judged By
Score
0
Total Time
≥985ms
Peak Memory
≥3.461 MiB