201592026-01-03 14:02:36herczegkatKét ajándékpython3Wrong answer 50/10017ms3324 KiB
'''
db=int(input())
eredeti=[int(i) for i in input().split()]
'''
eredeti=[1, 9, 6, 2, 7, 2, 8]
db=7
parH=db*[0]
parE=db*[0]
vanelottekisebb=False
for i in range(db-1,0,-1):
    mxkeresE=[]
    mxkeresH=[]
    
    for j in range(i-1,-1,-1):
         
         if eredeti[i]>eredeti[j]:
               vanelottekisebb=True
               mxkeresE.append(eredeti[i]+eredeti[j])
               mxkeresH.append(j)
               parE[i]=max(mxkeresE);     
               parH[i]=mxkeresH[mxkeresE.index(parE[i])]
               #print(i, parE[i],parH[i])
    

if vanelottekisebb==False:      
    print(0,0)
else:       
    ajandek2=parE.index(max(parE))
    ajandek1=parH[ajandek2]
    print(ajandek1+1,ajandek2+1)



SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3120 KiB
2Wrong answer16ms3120 KiB
subtask20/10
3Accepted16ms3144 KiB
4Accepted16ms2984 KiB
5Wrong answer16ms3136 KiB
6Accepted16ms3124 KiB
7Accepted17ms3104 KiB
subtask30/10
8Accepted16ms3308 KiB
9Wrong answer16ms3128 KiB
10Wrong answer14ms3320 KiB
11Wrong answer16ms3112 KiB
12Wrong answer14ms3124 KiB
subtask40/20
13Wrong answer16ms3272 KiB
14Wrong answer16ms3120 KiB
15Wrong answer16ms3124 KiB
16Wrong answer16ms3120 KiB
17Wrong answer17ms3084 KiB
18Wrong answer17ms3320 KiB
19Wrong answer16ms3320 KiB
20Wrong answer17ms3124 KiB
21Wrong answer16ms3128 KiB
22Wrong answer17ms3324 KiB
subtask50/10
23Wrong answer14ms3136 KiB
24Wrong answer17ms2880 KiB
25Wrong answer16ms2948 KiB
26Wrong answer16ms3112 KiB
27Wrong answer16ms3120 KiB
subtask610/10
28Accepted16ms2968 KiB
29Accepted16ms2916 KiB
30Accepted16ms3112 KiB
31Accepted16ms3116 KiB
32Accepted16ms3104 KiB
subtask710/10
33Accepted16ms3148 KiB
34Accepted16ms3120 KiB
35Accepted14ms2996 KiB
36Accepted16ms2980 KiB
37Accepted17ms3320 KiB
subtask830/30
38Accepted16ms3320 KiB
39Accepted16ms3152 KiB
40Accepted16ms2968 KiB
41Accepted16ms3124 KiB
42Accepted16ms3048 KiB
43Accepted14ms3120 KiB
44Accepted16ms2948 KiB
45Accepted16ms3088 KiB
46Accepted17ms3112 KiB
47Accepted17ms3128 KiB
48Accepted16ms3324 KiB
49Accepted17ms3124 KiB
50Accepted17ms3124 KiB
51Accepted17ms3136 KiB
52Accepted16ms3320 KiB