問題一覧 > 通常問題

No.1089 Three-Variable Equation

レベル : / AI推定難易度 : 130 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 193
作問者 : null / テスター : butsurizuki
お気に入りにしたユーザー ProblemId : 4572 / 自分の提出
問題文最終更新日: 2022-04-25 23:36: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

Problem Statement

Find the number of triples $(x,y,z)$ of non-negative integers (integers at least $0$) satisfying $x+y+z=N$.

Input

$N$

$0 \le N \le 3 \times 10^3$
All inputs are integers.

Output

Output the answer on one line, followed by a newline.

Sample

Sample 1
Input
2
Output
6

There are $6$ triples: $(2,0,0), (0,2,0), (0,0,2), (1,1,0), (0,1,1), (1,0,1)$.

Sample 2
Input
10
Output
66

Source

YSF Beginner Contest: B - Three-Variable Equation
writer: null
tester: butsuri_0523
Ported in accordance with HackerRank's terms. Some parts have been modified due to site-specific circumstances and other reasons.

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