結果
| 問題 | 
                            No.287 場合の数
                             | 
                    
| コンテスト | |
| ユーザー | 
                             maine_honzuki
                         | 
                    
| 提出日時 | 2021-05-13 10:29:08 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 31 ms / 5,000 ms | 
| コード長 | 550 bytes | 
| コンパイル時間 | 1,910 ms | 
| コンパイル使用メモリ | 196,388 KB | 
| 最終ジャッジ日時 | 2025-01-21 10:27:03 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
//https://ncode.syosetu.com/n4830bu/287/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    ll N;
    cin >> N;
    vector<ll> maine(N * 2 + 1);
    maine[0] = 1;
    for (int _ = 0; _ < 8; _++) {
        vector<ll> book(N * 2 + 1);
        for (int i = 0; i <= N * 2; i++) {
            for (int j = 0; j <= N; j++) {
                if (i + j > N * 2)
                    break;
                book[i + j] += maine[i];
            }
        }
        swap(maine, book);
    }
    cout << maine[N * 2] << endl;
}
            
            
            
        
            
maine_honzuki