結果
問題 |
No.64 XORフィボナッチ数列
|
ユーザー |
|
提出日時 | 2018-04-22 18:58:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 502 ms |
コンパイル使用メモリ | 64,160 KB |
実行使用メモリ | 13,880 KB |
最終ジャッジ日時 | 2024-06-27 07:01:18 |
合計ジャッジ時間 | 7,193 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 TLE * 1 -- * 4 |
ソースコード
#include<iostream> using namespace std; int main(){ long long f0,f1,f2,n; cin >> f0 >> f1 >> n; if(n < 2){ if(n == 0){ cout << f0 << endl; }else{ cout << f1 << endl; } return 0; } long long now = 2; while(now != n+1){ f2 = f0^f1; f0 = f1; f1 = f2; now++; } cout << f1 << endl; return 0; }