問題一覧 > 通常問題

No.369 Addition Mistake

レベル : / AI推定難易度 : 75 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 783
作問者 : naimonon77 / テスター : 🍡yurahuna
お気に入りにしたユーザー ProblemId : 1039 / 自分の提出
問題文最終更新日: 2018-12-13 17:14:57
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 137 (順位表) の他の問題:

Problem Statement

yuki is bad at addition and often makes mistakes when adding.
Given N numbers and yuki's answer, output the value of "the true answer" $-$ "yuki's answer".

Input

$N$
$A_1$ $A_2$ $\dots$ $A_N$
$v$

$1 \leq N \leq 10^4$
$-10^4\leq A_i \leq 10^4$
$-10^8 \leq v \leq 10^8$ $N,A_i,vともに整数$
$v$ is yuki's answer.

Output

Output the value of "the true answer" − "yuki's answer".

Sample

Sample 1
Input
4
5 1 4 3
10
Output
3

The sum is 13, while yuki's answer is 10, so it is short by 3.

Sample 2
Input
3
2 1 -1
0
Output
2

The input may contain negative numbers.

Sample 3
Input
3
-5 -2 -4
0
Output
-11

The output may be negative.

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