結果
| 問題 | No.554 recurrence formula |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-13 17:38:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 487 ms |
| コンパイル使用メモリ | 57,904 KB |
| 実行使用メモリ | 16,712 KB |
| 最終ジャッジ日時 | 2024-11-25 00:27:36 |
| 合計ジャッジ時間 | 34,241 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 TLE * 11 |
ソースコード
#include <iostream>
using namespace std;
typedef unsigned long long UL;
UL MOD=1000000007;
UL f(int n){
if (n==1){
return 1;
}
int i;
UL x=0;
int startI;
if (n%2==0){
startI=1;
}else{
startI=2;
}
for (i=startI;i<=n-1;i+=2){
x+=f(i);
}
x*=n;
x%=MOD;
return x;
}
int main(int argc, char* argv[])
{
int n;
cin>>n;
UL aw=f(n);
cout<<aw<<endl;
return 0;
}