結果
問題 |
No.851 テストケース
|
ユーザー |
![]() |
提出日時 | 2020-04-02 21:25:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 3,153 ms |
コード長 | 553 bytes |
コンパイル時間 | 203 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-28 15:18:58 |
合計ジャッジ時間 | 1,780 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines n = int(readline().strip()) a = [int(x) for x in readline().strip().split()] if (len(a) == 3): print('"assert"') exit() a = [a[0]] for i in range(2): a.append(int(readline().strip())) cans = [] for i in range(len(a)): for j in range(i + 1, len(a)): total = a[i] + a[j] if total not in cans: cans.append(total) cans = sorted(cans, reverse=True) print(cans[1] if len(cans) > 1 else cans[0])