結果
問題 | No.64 XORフィボナッチ数列 |
ユーザー |
|
提出日時 | 2021-01-10 21:48:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 802 ms |
コンパイル使用メモリ | 74,192 KB |
最終ジャッジ日時 | 2025-01-17 16:01:52 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <algorithm> #include <array> #include <cstdio> #include <iostream> #include <numeric> #include <optional> #include <vector> using namespace std; int main() { int64_t f0, f1, n; cin >> f0 >> f1 >> n; int64_t ans; if (n % 3 == 0) ans = f0; else if (n % 3 == 1) ans = f1; else ans = f0 ^ f1; cout << ans << endl; return 0; }