結果

問題 No.287 場合の数
ユーザー char134217728
提出日時 2017-07-30 05:34:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 561 bytes
コンパイル時間 1,261 ms
コンパイル使用メモリ 157,608 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-10 21:27:24
合計ジャッジ時間 2,244 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:16:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   16 | main(){
      | ^~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef set<int> si;
const int inf = 1e9;
const int mod = 1e9+7;

ll a[9][601];
int m, n;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  m = n * 6;
  a[0][0] = 1;
  FOR(i, 1, 9){
    FOR(j, 0, m + 1){
      FOR(k, 0, min(j,n)+1){
        a[i][j] += a[i-1][j-k];
      }
    }
  }
  cout << a[8][m] << endl;
}
0