ログインしてください。
提出 #73070146
ソースコード 拡げる
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)
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - AtCoder Riko |
| ユーザ | gett |
| 言語 | Python (PyPy 3.11-v7.3.20) |
| 得点 | 350 |
| コード長 | 460 Byte |
| 結果 | AC |
| 実行時間 | 150 ms |
| メモリ | 196968 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 350 / 350 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 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 |