結果

問題 No.1229 ラグビーの得点パターン
ユーザー hgoto
提出日時 2020-10-27 13:44:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 1,663 ms
コンパイル使用メモリ 191,644 KB
最終ジャッジ日時 2025-01-15 16:00:54
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void()
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int ans = 0;
  for (int t = 0; t <= n / 5; t++) {
    for (int g = 0; g <= t; g++) {
      for (int pg = 0; pg <= n / 3; pg++) {
        if (t * 5 + g * 2 + pg * 3 == n) ans++;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
0