問題一覧 > 通常問題

No.1229 Rugby Scoring Patterns

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 464
作問者 : yuppe19 😺 / テスター : hotman78
お気に入りにしたユーザー ProblemId : 3976 / 自分の提出
問題文最終更新日: 2020-04-19 16:54:40
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 266 (順位表) の他の問題:

Problem Statement

You are given a rugby team's score $N$.
Count the number of combinations of tries (T: $5$ points), conversions (G: $2$ points), and penalty goals (PG: $3$ points) that total $N$ points.
Note that since a conversion is a kick taken after a try, the number of conversions is always at most the number of tries.
Also, assume that there were no drop goals or penalty tries.

Input

$N$

  • $N$ is an integer satisfying $0 \le N \le 100$.

Output

Output the number of patterns, followed by a newline.

Sample

Sample 1
Input
0
Output
1

When no points are scored, there is only $1$ pattern: $(T, G, PG) = (0, 0, 0)$.

Sample 2
Input
5
Output
1

The only way to total $5$ points is the $1$ pattern $(T, G, PG) = (1, 0, 0)$.
$(T, G, PG) = (0, 1, 1)$ is not valid because the number of conversions exceeds the number of tries.

Sample 3
Input
20
Output
4

There are $4$ patterns: $(T, G, PG) = \{(4, 0, 0), (3, 1, 1), (2, 2, 2), (1, 0, 5)\}$.

Sample 4
Input
100
Output
55
---

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