結果
問題 | No.64 XORフィボナッチ数列 |
ユーザー |
|
提出日時 | 2017-05-03 19:02:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 549 ms |
コンパイル使用メモリ | 56,288 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 07:08:07 |
合計ジャッジ時間 | 1,043 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <iostream> using namespace std; int main(int argc, const char* argv[]) { uint64_t F0, F1, N, F2; cin >> F0 >> F1 >> N; N %= 3; if (N == 0) { cout << F0 << endl; return 0; } for (uint64_t i = 2; i <= N; i++) { F2 = F1 ^ F0; F0 = F1; F1 = F2; } cout << F1 << endl; return 0; }