結果

問題 No.1229 ラグビーの得点パターン
ユーザー yvay5cqeyvay5cqe
提出日時 2020-09-27 22:38:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,236 bytes
コンパイル時間 4,455 ms
コンパイル使用メモリ 230,948 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 13:59:45
合計ジャッジ時間 5,384 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define each(a, x) for (auto &a : (x))
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define int long long
#define yn(x) puts((x ? "Yes" : "No"))
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
const int MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;

void input()
{
  ;
  cin >> N;
  ;
}
void solve()
{
  int n = N;
  // 2,3,5
  int ans = 0;
  rep(i, 0, n)
  {
    rep(j, 0, n)
    {
      rep(k, 0, n)
      {
        if (i * 2 + j * 3 + k * 5 == N)
        {
          if (i <= k)
          {
            ans++;
          }
        }
      }
    }
  }
  cout << ans << endl;

  ;
  ;
}
signed main()
{
  cout << setprecision(12);
  input();
  solve();
  return 0;
}
0