Time Exceeded
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(1,y+1):
high=0
for j in li:
if j%i==0:
high+=j
res.append(high)
print(res.index(min(res))+1)
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:29:24
- Judged At
- 2024-11-11 03:32:10
- Judged By
- Score
- 75
- Total Time
- ≥4093ms
- Peak Memory
- ≥12.898 MiB