結果
問題 |
No.64 XORフィボナッチ数列
|
ユーザー |
![]() |
提出日時 | 2014-11-13 23:55:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 588 bytes |
コンパイル時間 | 752 ms |
コンパイル使用メモリ | 65,824 KB |
実行使用メモリ | 13,636 KB |
最終ジャッジ日時 | 2024-12-31 10:20:55 |
合計ジャッジ時間 | 25,468 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 TLE * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%lld%lld%lld",&f0,&f1,&n); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio> #include <cstdlib> #include <iostream> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <stack> using namespace std; int main(){ long long f0,f1,f2,n; scanf("%lld%lld%lld",&f0,&f1,&n); if(n==0){ cout << f0 << endl; return 0; } if(n==1){ cout << f1 << endl; return 0; } for(long long i=2;i<=n;i++){ f2=f1^f0; f0=f1; f1=f2; } cout << f1 << endl; return 0; }