結果

問題 No.64 XORフィボナッチ数列
ユーザー Hydrogen332
提出日時 2024-09-27 01:12:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 2,192 ms
コンパイル使用メモリ 191,376 KB
最終ジャッジ日時 2025-02-24 12:58:48
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)s; i < (int)e; i++)

int main() {
    cin.tie(nullptr);
    
    ll F0, F1, N;
    cin >> F0 >> F1 >> N;
    
    if (N % 3 == 0) cout << F0 << '\n';
    else if (N % 3 == 1) cout << F1 << '\n';
    else cout << (F0 ^ F1) << '\n';
}
0