問題一覧 > 通常問題

No.851 Test Case

レベル : / 実行時間制限 : 1ケース 3.153秒 / メモリ制限 : 315 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 320
作問者 : CuriousFairy315 / テスター : KoshStorm
お気に入りにしたユーザー ProblemId : 3122 / 自分の提出
問題文最終更新日: 2019-07-26 23:52:18
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 218 (順位表) の他の問題:

Problem Statement

You, a competitive programmer, have been asked by your friend 31536000 to act as a tester for a problem.
The problem is as follows.

$3$ values are given.
Among the values that can be obtained by adding $2$ of them, output the $2$-nd largest.

After reading this problem, you immediately wrote code and submitted it, but it fails on only some of the cases.
Puzzled, you checked the test cases and found that some of them are space-separated rather than newline-separated.
So you decided to output a notice to that effect for the incorrect test cases.

Input

$N$
$A_1$
$\vdots$
$A_N$

・$N = 3$
・$1 \leq A_i \leq 10^{10}$
・$A_1 \neq A_N$
・All inputs are given as integers

Output

Among the values that can be obtained by adding 2 of them, output the 2-nd largest.
However, if the input format is
$N$
$A_1$ $\cdots$ $A_N$
then output "assert" instead.
In either case, end the output with a newline.
Also, in this problem, the 2-nd largest value refers to the value that is second from the largest. (There is no error in test case 2.)

Sample

Sample 1
Input
3
1
5
3
Output
6

Among 1+5, 1+3, 5+3, the 2-nd largest value is 6.

Sample 2
Input
3
3
3
4
Output
6

Among 3+3, 3+4, 3+4, the 2-nd largest value is 6.
Note that since the only possible values are 6 and 7, the 2-nd largest value is 6.

Sample 3
Input
3
1 5 3
Output
"assert"

This is an incorrect test case, so output "assert".

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。