結果
問題 |
No.64 XORフィボナッチ数列
|
ユーザー |
|
提出日時 | 2015-02-15 22:13:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 403 bytes |
コンパイル時間 | 491 ms |
コンパイル使用メモリ | 57,536 KB |
実行使用メモリ | 10,272 KB |
最終ジャッジ日時 | 2024-06-23 20:23:32 |
合計ジャッジ時間 | 6,973 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 TLE * 1 -- * 4 |
ソースコード
#include <iostream> #include <algorithm> #include <cstring> #include <climits> typedef long long LL; using namespace std; int main() { LL F[2], N, ans; cin >> F[0] >> F[1] >> N; while (N) { F[0] ^= F[1]; swap(F[0], F[1]); --N; } switch (N % 3) { case 0: ans = F[0]; break; case 1: ans = F[1]; break; case 2: ans = F[0] ^ F[1]; break; } cout << ans << endl; return 0; }