結果
| 問題 | No.851 テストケース |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-02 07:58:19 |
| 言語 | Ruby (4.0.6) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 3,153 ms |
| + 714µs | |
| コード長 | 316 bytes |
| 記録 | |
| コンパイル時間 | 9 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 14,592 KB |
| 最終ジャッジ日時 | 2026-08-27 12:57:43 |
| 合計ジャッジ時間 | 2,715 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.chomp.to_i
a0 = gets.chomp.split
if a0.size > 1
p "assert"
exit
end
a0 = a0[0].to_i
a_s = [a0]
(n - 1).times {
a = gets.chomp.to_i
a_s << a
}
def sum_of_2 l
s = []
l.combination(2) {|a, b|
s << a + b
}
s
end
sum_s = sum_of_2 a_s
sum_s = sum_s.sort.uniq
p sum_s[-2]