結果
問題 | No.287 場合の数 |
ユーザー | Lay_ec |
提出日時 | 2015-10-09 23:13:50 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 780 bytes |
コンパイル時間 | 877 ms |
コンパイル使用メモリ | 79,012 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 23:56:06 |
合計ジャッジ時間 | 1,564 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <cmath> #include <algorithm> #include <cstdlib> #include <ctime> #include <cstdio> #include <functional> #include <set> #include <sstream> #include <map> #include <queue> #include <stack> using namespace std; long long n; long long ans; void dfs(long long cnt,long long sum){ if(cnt==8){ if(sum==6*n) ans++; return ; } for(int i=0;i<=n;i++){ dfs(cnt+1,sum+i); } } int main() { /* for(int i=0;i<16;i++){ n=i; ans=0; dfs(0,0); cout<<i<<" "<<ans<<endl; } */ cin>>n; n++; //https://oeis.org/A179098 long long res=n*(90+77*n+140*pow(n,3)+210*pow(n,4)+98*pow(n,5)+15*pow(n,6))/630; cout<<res<<endl; return 0; }