No.851 Test Case
タグ : / 解いたユーザー数 320
作問者 :
CuriousFairy315
/ テスター :
KoshStorm
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もしくは右上の雲マークをクリックしてアカウントを作成してください。