/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 21ms 2.875 MiB
#2 Runtime Error Traceback (most recent call last): File "foo.py", line 12, in <module> ValueError: min() iterable argument is empty 49ms 4.969 MiB
#3 Accepted 72ms 4.957 MiB
#4 Wrong Answer 83ms 4.828 MiB

Code

t=int(input())
for x in range(t):
    n,y=map(int,input().split())
    li=list(map(int,input().split()))
    res=[]
    for i in range(2,y+1):
        high=0
        for j in li:
            if j%i==0:
                high+=j
        res.append(high)
    print(res.index(min(res))+2)


Information

Submit By
Type
Submission
Problem
P1039 Prince Roy, the undisputed ruler of the world
Contest
Brain Booster #3
Language
Python 3 (Python 3.12.3)
Submit At
2024-05-06 17:41:45
Judged At
2024-11-11 03:32:00
Judged By
Score
20
Total Time
83ms
Peak Memory
4.969 MiB