結果
| 問題 |
No.64 XORフィボナッチ数列
|
| コンテスト | |
| ユーザー |
Kurichan0806
|
| 提出日時 | 2017-12-12 17:25:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 496 bytes |
| コンパイル時間 | 794 ms |
| コンパイル使用メモリ | 82,720 KB |
| 実行使用メモリ | 1,569,300 KB |
| 最終ジャッジ日時 | 2024-12-14 06:00:51 |
| 合計ジャッジ時間 | 47,257 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | MLE * 3 |
| other | TLE * 3 MLE * 8 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <functional>
#include <cmath>
using namespace std;
#define lli long long int
#define MAX 100000000 + 1
lli dp[MAX];
lli fib(lli n) {
//cout << n << " " << dp[n] << endl;
if (dp[n] > -1)
return dp[n];
else
return dp[n] = fib(n - 1) ^ fib(n - 2);
}
int main() {
for (int i = 0; i < MAX; i++)
dp[i] = -5;
lli n, x;
cin >> dp[0] >> dp[1] >> n;
cout << fib(n) << endl;
return 0;
}
Kurichan0806