201412026-01-02 23:04:07herczegkatKét ajándékpython3Runtime error 0/10017ms3480 KiB
db=int(input())
eredeti=[int(i) for i in input().split()]
MX=max(eredeti)+1
rendH=(db)*[0]
rendE=(db)*[0]
parH=(db)*[0]
ossz=(db)*[0]
for i in range(db):
    MnE=min(eredeti);MnH=eredeti.index(MnE)
    rendE[i]=MnE;rendH[i]=MnH
    eredeti[MnH]=MX
for i in range(1, db)   :
    V=i-1
    eLNhelye=rendE.index(max(rendE[0:V+1]))
    mutato=rendH[eLNhelye]
    while mutato>rendH[i] or rendE[i]==rendE[eLNhelye] and V>-1:
        V-=1
        eLNhelye=rendE.index(max(rendE[0:V+1]))
        mutato=rendH[eLNhelye]
    if V==-1:
        parH[i]=-1;
        ossz[i]=0                         
    else:
        parH[i]=mutato
        ossz[i]=rendE[i]+rendE[eLNhelye]                            
if max(ossz)=0:
    print(0,0)
else:
    jo=ossz.index(max(ossz))
    print(parH[jo]+1,rendH[jo]+1)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Runtime error16ms3312 KiB
2Runtime error16ms3212 KiB
subtask20/10
3Runtime error16ms3124 KiB
4Runtime error17ms3236 KiB
5Runtime error17ms3232 KiB
6Runtime error16ms3232 KiB
7Runtime error17ms3132 KiB
subtask30/10
8Runtime error17ms3124 KiB
9Runtime error17ms3144 KiB
10Runtime error17ms3124 KiB
11Runtime error17ms3120 KiB
12Runtime error16ms3320 KiB
subtask40/20
13Runtime error17ms3136 KiB
14Runtime error17ms3108 KiB
15Runtime error17ms3124 KiB
16Runtime error17ms3124 KiB
17Runtime error17ms3096 KiB
18Runtime error16ms3132 KiB
19Runtime error16ms3164 KiB
20Runtime error16ms3144 KiB
21Runtime error17ms3124 KiB
22Runtime error17ms3124 KiB
subtask50/10
23Runtime error16ms3124 KiB
24Runtime error17ms3360 KiB
25Runtime error17ms3128 KiB
26Runtime error16ms3280 KiB
27Runtime error16ms3124 KiB
subtask60/10
28Runtime error17ms3136 KiB
29Runtime error17ms3124 KiB
30Runtime error16ms3124 KiB
31Runtime error17ms3480 KiB
32Runtime error16ms3140 KiB
subtask70/10
33Runtime error16ms3124 KiB
34Runtime error16ms3260 KiB
35Runtime error16ms3140 KiB
36Runtime error17ms3124 KiB
37Runtime error16ms3148 KiB
subtask80/30
38Runtime error16ms3124 KiB
39Runtime error16ms3128 KiB
40Runtime error16ms3124 KiB
41Runtime error17ms3320 KiB
42Runtime error17ms3184 KiB
43Runtime error17ms3080 KiB
44Runtime error16ms3080 KiB
45Runtime error16ms3288 KiB
46Runtime error16ms3108 KiB
47Runtime error17ms3228 KiB
48Runtime error16ms3152 KiB
49Runtime error17ms3124 KiB
50Runtime error16ms3196 KiB
51Runtime error17ms3100 KiB
52Runtime error16ms3264 KiB