111862024-07-15 20:35:37probaLegnagyobb téglalappython3Wrong answer 0/10018ms3256 KiB
#N = input()
sor = [int(i) for i in '2 4 4 2'.strip().split(' ')]

sor.sort(reverse=True)
h = len(sor)

i, a, b, ok = 0, None, None, True

  
while i < h-3 and h > 3:
    
    if sor.count(sor[i]) > 3:
        print(sor[i]**2)
        ok = False
    else:
        if sor[i] == sor[i+1] and a == None:
            a, j = sor[i], 0
            while i+j < h-3 and sor[i+j] == a:
                j += 1
            i += j+1
            print(i, sor[i])
            if sor[i] == sor[i+1] and b == None:
                print(a*sor[i])
                ok = False
                break
    
    i += 1

if ok:
    print(0)

    
        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms3044 KiB
2Wrong answer17ms3044 KiB
3Wrong answer17ms3044 KiB
subtask20/10
4Wrong answer17ms3120 KiB
5Wrong answer17ms3044 KiB
6Wrong answer17ms3192 KiB
7Wrong answer17ms3172 KiB
8Wrong answer17ms2916 KiB
subtask30/10
9Wrong answer17ms3000 KiB
10Wrong answer18ms2976 KiB
11Wrong answer17ms3072 KiB
12Wrong answer17ms3044 KiB
13Wrong answer17ms3100 KiB
14Wrong answer17ms3048 KiB
subtask40/15
15Wrong answer17ms3112 KiB
16Wrong answer17ms3044 KiB
17Wrong answer17ms3192 KiB
18Wrong answer18ms3216 KiB
19Wrong answer17ms3088 KiB
20Wrong answer17ms2916 KiB
21Wrong answer17ms2916 KiB
22Wrong answer17ms3064 KiB
23Wrong answer18ms3080 KiB
24Wrong answer17ms3044 KiB
subtask50/20
25Wrong answer17ms3204 KiB
26Wrong answer17ms3088 KiB
27Wrong answer17ms3088 KiB
28Wrong answer17ms3044 KiB
29Wrong answer18ms3044 KiB
30Wrong answer17ms3096 KiB
31Wrong answer17ms3044 KiB
32Wrong answer17ms2972 KiB
subtask60/15
33Wrong answer17ms3064 KiB
34Wrong answer17ms3044 KiB
35Wrong answer17ms3048 KiB
36Wrong answer18ms3080 KiB
37Wrong answer18ms2964 KiB
38Wrong answer17ms3172 KiB
39Wrong answer17ms2952 KiB
40Wrong answer17ms3044 KiB
41Wrong answer17ms2916 KiB
subtask70/30
42Wrong answer17ms3064 KiB
43Wrong answer18ms3104 KiB
44Wrong answer17ms3256 KiB
45Wrong answer18ms2944 KiB
46Wrong answer17ms3028 KiB
47Wrong answer17ms3088 KiB
48Wrong answer17ms3196 KiB
49Wrong answer17ms3044 KiB
50Wrong answer17ms3192 KiB
51Wrong answer17ms3044 KiB