結果

問題 No.64 XORフィボナッチ数列
ユーザー たこしたこし
提出日時 2014-11-12 23:27:42
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 731 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 86,104 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-08-30 03:18:57
合計ジャッジ時間 7,415 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define INF 1000000000
#define EPS 1e-9
#define PI acos(-1)

typedef long long ll;
typedef pair<int, int> P;

ll F[3], N;

int main(){

  cin >> F[0] >> F[1] >> N;

  for(int i = 2; i <= N; i++){
    F[i%3] = F[(i-1)%3]^F[(i-2)%3];
  }

  cout << F[N%3] << endl;

  return 0;
  
}
0