結果

問題 No.64 XORフィボナッチ数列
ユーザー cocomoffcocomoff
提出日時 2019-08-06 09:53:28
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 288 bytes
コンパイル時間 1,345 ms
コンパイル使用メモリ 145,240 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 17:38:00
合計ジャッジ時間 3,373 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h> 

using namespace std;
typedef long long ll;

int main() {
    ll F0, F1, N;
    cin >> F0 >> F1 >> N;
    vector<ll> v(N+1, 0);
    v[0] = F0;
    v[1] = F1;
    for (int i = 2; i <= N; i++) {
        v[i] = v[i - 2] ^ v[i - 1];
    }
    cout << v[N] << endl;
}
0