結果

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

ソースコード

diff #

//   __
//  / <@フ
//  |(ノノハ))
//  ノ从゚ヮ゚从
//  ノ|ソノГ|つ author:hotarunx
// 〈_ノ^^^ヽ|
//  ~~tァtァ~
#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define int long long

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    int ans = 0;

    for (int t = 0; t <= 100; t++) {
        for (int g = 0; g <= t; g++) {
            for (int pg = 0; pg <= 100; pg++) {
                const int point = 5 * t + 2 * g + 3 * pg;
                if (point == n)
                    ans++;
                else if (point > n)
                    break;
            }
        }
    }

    cout << ans << "\n";
}
0