結果

問題 No.64 XORフィボナッチ数列
ユーザー chiyodachiyoda
提出日時 2016-06-26 19:45:38
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 348 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 59,688 KB
実行使用メモリ 814,312 KB
最終ジャッジ日時 2024-04-20 03:24:51
合計ジャッジ時間 2,392 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main() {
  unsigned long long f0, f1, n;
  cin >> f0 >> f1 >> n;
  vector<unsigned long long> v;
  v.push_back(f0);
  v.push_back(f1);
  for (int i = 2; i < n + 1; i++) {
    unsigned long long tmp = v[i - 1] ^ v[i - 2];
    v.push_back(tmp);
  }
  cout << v[n] << endl;
  return 0;
}
0