結果

問題 No.64 XORフィボナッチ数列
ユーザー f843nmfwisfeuw
提出日時 2020-09-01 21:06:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 692 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 93,152 KB
実行使用メモリ 10,148 KB
最終ジャッジ日時 2024-11-20 16:56:26
合計ジャッジ時間 25,623 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>
#include <set>
#include <queue>
#include <bitset>
#include <cassert>

using namespace std;

int main() {

    unsigned long long F0, F1, N;
    cin >> F0 >> F1 >> N;


    if (N == 0) {
        cout << F0 << endl;
    } else if (N == 1) {
        cout << F1 << endl;
    } else {
        unsigned long long Fi;
        for (int i = 1; i < N; ++i) {
            Fi = F1 ^ F0;
            unsigned long long tmp = F1;
            F1 = Fi;
            F0 = tmp;
        }
        cout << Fi << endl;
    }


}
0