115682024-10-27 01:47:07balintLegnagyobb téglalappython3Wrong answer 10/10083ms22252 KiB
from collections import Counter
import sys
def main():
    nums = sorted([(num, count) for num, count in Counter(map(int, sys.stdin.read().splitlines()[1].split())).items() if count > 1], reverse=True, key= lambda x: x[0])
    if len(nums) == 0:
        print(0)
    elif len(nums) == 1:
        print(nums[0][0]**2 if nums[0][1] >= 4 else 0)
    else:
        print(nums[0][0] * nums[1][0])

main()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3368 KiB
2Accepted18ms3576 KiB
3Accepted18ms3284 KiB
subtask210/10
4Accepted19ms3400 KiB
5Accepted18ms3388 KiB
6Accepted18ms3268 KiB
7Accepted18ms3528 KiB
8Accepted18ms3384 KiB
subtask30/10
9Accepted18ms3348 KiB
10Accepted18ms3556 KiB
11Accepted18ms3384 KiB
12Accepted18ms3384 KiB
13Accepted41ms4924 KiB
14Wrong answer39ms4784 KiB
subtask40/15
15Accepted18ms3384 KiB
16Accepted17ms3384 KiB
17Accepted18ms3576 KiB
18Accepted18ms3524 KiB
19Accepted19ms3524 KiB
20Accepted18ms3488 KiB
21Accepted18ms3504 KiB
22Accepted17ms3376 KiB
23Wrong answer18ms3400 KiB
24Accepted18ms3460 KiB
subtask50/20
25Accepted19ms3504 KiB
26Accepted20ms4204 KiB
27Accepted20ms4112 KiB
28Accepted20ms4180 KiB
29Accepted23ms4152 KiB
30Wrong answer20ms4236 KiB
31Accepted20ms4152 KiB
32Accepted19ms3896 KiB
subtask60/15
33Accepted19ms3516 KiB
34Accepted67ms16760 KiB
35Accepted81ms22252 KiB
36Accepted75ms22084 KiB
37Accepted82ms22212 KiB
38Wrong answer74ms22248 KiB
39Accepted75ms22236 KiB
40Accepted21ms4152 KiB
41Accepted61ms12556 KiB
subtask70/30
42Wrong answer56ms10916 KiB
43Accepted75ms22252 KiB
44Accepted83ms22248 KiB
45Accepted83ms22252 KiB
46Accepted75ms22216 KiB
47Wrong answer75ms22172 KiB
48Accepted76ms22108 KiB
49Accepted82ms22248 KiB
50Accepted67ms12448 KiB
51Accepted72ms13932 KiB