提出 #73059681
ソースコード 拡げる
n = int(input())
L = list(map(int,input().split()))
L.sort()
ans = []
if n%2 == 0:
f = True
x = L[0]+L[-1]
for i in range(n//2):
if L[i]+L[n-i-1] != x: f = False
if f: ans.append(x)
x = L[-1]
idx = n-1
while idx >= 0 and L[idx] == x:
idx -= 1
if idx%2:
f = True
for i in range(idx//2+1):
if L[i]+L[idx-i] != x: f = False
if f: ans.append(x)
ans.sort()
print(*ans)
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - AtCoder Riko |
| ユーザ | Cenix820 |
| 言語 | Python (PyPy 3.11-v7.3.20) |
| 得点 | 350 |
| コード長 | 437 Byte |
| 結果 | AC |
| 実行時間 | 132 ms |
| メモリ | 152356 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 | 49 ms | 79816 KiB |
| 0_sample_2.txt | AC | 49 ms | 79784 KiB |
| 0_sample_3.txt | AC | 48 ms | 79860 KiB |
| 1_1.txt | AC | 126 ms | 151228 KiB |
| 1_2.txt | AC | 125 ms | 145828 KiB |
| 1_3.txt | AC | 125 ms | 149004 KiB |
| 1_4.txt | AC | 125 ms | 146400 KiB |
| 1_5.txt | AC | 124 ms | 148596 KiB |
| 2_1.txt | AC | 131 ms | 146868 KiB |
| 2_2.txt | AC | 130 ms | 146692 KiB |
| 2_3.txt | AC | 130 ms | 152344 KiB |
| 2_4.txt | AC | 130 ms | 151740 KiB |
| 3_1.txt | AC | 132 ms | 150148 KiB |
| 3_2.txt | AC | 132 ms | 152356 KiB |
| 3_3.txt | AC | 132 ms | 147028 KiB |
| 3_4.txt | AC | 115 ms | 147088 KiB |
| 3_5.txt | AC | 49 ms | 79836 KiB |
| 3_6.txt | AC | 124 ms | 147040 KiB |
| 4_1.txt | AC | 82 ms | 146472 KiB |
| 4_2.txt | AC | 99 ms | 148808 KiB |
| 4_3.txt | AC | 49 ms | 79440 KiB |
| 4_4.txt | AC | 49 ms | 79584 KiB |