結果
問題 |
No.1877 俺自身が線グラフになることだ
|
ユーザー |
![]() |
提出日時 | 2022-03-18 21:40:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 3,645 ms |
コンパイル使用メモリ | 229,724 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-10-03 06:26:25 |
合計ジャッジ時間 | 4,177 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using ll=long long; using Graph=vector<vector<pair<int,char>>>; #define MAX 1000 #define MOD 1000000007 //#define MOD 998244353 //#define INF 1000000000 #define INF 1000000000000000000 int main(){ int N; cin>>N; if(N==1||N==2){ cout<<0<<'\n'; }else{ vector<ll> dp(N+1,0); dp[0]=1; for(int d=3;d<=N;d++){ for(int i=0;i+d<=N;i++){ dp[i+d]+=dp[i]; } } cout<<dp[N]<<'\n'; } }