結果

問題 No.1229 ラグビーの得点パターン
ユーザー tapioka324tapioka324
提出日時 2020-09-28 22:22:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 1,834 ms
コンパイル使用メモリ 192,288 KB
最終ジャッジ日時 2025-01-14 23:19:44
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define endl "\n"
#define rep(i, a, n) for (int i = a; i < n; ++i)
#define all(x) (x).begin(), (x).end()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;

    int ans = 0;
    rep(i, 0, n + 1) {
        rep(j, 0, n + 1) {
            rep(k, 0, n + 1) {
                if (5 * i + 2 * j + 3 * k == n && i >= j) ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}
0