結果

問題 No.1877 俺自身が線グラフになることだ
ユーザー SSRSSSRS
提出日時 2022-03-18 21:29:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 2,196 ms
コンパイル使用メモリ 199,592 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-14 09:16:37
合計ジャッジ時間 2,991 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main(){
  int N;
  cin >> N;
  vector<vector<long long>> dp(N + 1, vector<long long>(N + 1, 0));
  for (int i = 0; i < N; i++){
    for (int j = 0; j <= N; j++){
      dp[i + 1][j] = dp[i][j];
      if (j >= i){
        dp[i + 1][j] += dp[i][j - i];
        dp[i + 1][j] %= MOD;
      }
    }
  }
  cout << dp[N][N] << endl;
}
0