Submission #73070146
Source Code Expand
n = int(input())
a = list(map(int, input().split()))
a.sort()
riko = [a[-1], a[0] + a[-1]]
ans = []
for l in riko:
if l < a[-1]:
continue
temp = [x for x in a if x != l]
if len(temp) % 2 != 0:
continue
flag = True
for i in range(len(temp) // 2):
if temp[i] + temp[len(temp)-1-i] != l:
flag = False
break
if flag:
ans.append(l)
print(*ans)
Submission Info
| Submission Time | |
|---|---|
| Task | C - AtCoder Riko |
| User | gett |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 350 |
| Code Size | 460 Byte |
| Status | AC |
| Exec Time | 150 ms |
| Memory | 196968 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 350 / 350 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt |
| All | 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt, 1_1.txt, 1_2.txt, 1_3.txt, 1_4.txt, 1_5.txt, 2_1.txt, 2_2.txt, 2_3.txt, 2_4.txt, 3_1.txt, 3_2.txt, 3_3.txt, 3_4.txt, 3_5.txt, 3_6.txt, 4_1.txt, 4_2.txt, 4_3.txt, 4_4.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_sample_1.txt | AC | 45 ms | 79864 KiB |
| 0_sample_2.txt | AC | 45 ms | 79976 KiB |
| 0_sample_3.txt | AC | 44 ms | 79768 KiB |
| 1_1.txt | AC | 137 ms | 187052 KiB |
| 1_2.txt | AC | 137 ms | 181764 KiB |
| 1_3.txt | AC | 137 ms | 185060 KiB |
| 1_4.txt | AC | 136 ms | 182340 KiB |
| 1_5.txt | AC | 136 ms | 185000 KiB |
| 2_1.txt | AC | 149 ms | 191336 KiB |
| 2_2.txt | AC | 148 ms | 191924 KiB |
| 2_3.txt | AC | 148 ms | 196968 KiB |
| 2_4.txt | AC | 147 ms | 196524 KiB |
| 3_1.txt | AC | 150 ms | 194560 KiB |
| 3_2.txt | AC | 150 ms | 195056 KiB |
| 3_3.txt | AC | 150 ms | 191988 KiB |
| 3_4.txt | AC | 131 ms | 186300 KiB |
| 3_5.txt | AC | 48 ms | 79688 KiB |
| 3_6.txt | AC | 143 ms | 191724 KiB |
| 4_1.txt | AC | 90 ms | 170124 KiB |
| 4_2.txt | AC | 106 ms | 171544 KiB |
| 4_3.txt | AC | 48 ms | 79868 KiB |
| 4_4.txt | AC | 47 ms | 79728 KiB |