問題一覧 > 通常問題

No.1686 Geschenkt

レベル : / AI推定難易度 : 120 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 347
作問者 : ansain / テスター : noya2 ygussany
お気に入りにしたユーザー ProblemId : 6546 / 自分の提出
問題文最終更新日: 2021-10-02 01:34:08
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 315 (順位表) の他の問題:

Problem Statement

You have $N$ cards, and the $i$-th $(1 \le i \le N)$ card has the integer $A_i$ written on it. The score of the cards you hold is defined as follows. What is the score?

  • The sum of the integers written on those cards you hold for which "you do not hold a card with the integer exactly $1$ smaller than the integer written on it"
  • Input

    $N$
    $A_1$ $A_2$ $\dots$ $A_N$
  • $1 \le N \le 33$
  • $3 \le A_i \le 35$
  • The $A_i$ are pairwise distinct
  • All inputs are integers
  • Output

    Print the score. End the output with a newline.

    Sample

    Sample 1
    Input
    4
    5 6 7 31
    Output
    36

    The cards that contribute to the score are the ones with $5$ and $31$ written on them.

    Sample 2
    Input
    5
    8 15 7 16 14
    Output
    21

    $A$ is not necessarily sorted in ascending order.

    Sample 3
    Input
    17
    3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35
    Output
    323

    Incidentally, in the game called Geschenkt, a higher score is worse.

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