結果

問題 No.64 XORフィボナッチ数列
ユーザー fumi6328fumi6328
提出日時 2018-10-06 12:31:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 262 bytes
コンパイル時間 2,710 ms
コンパイル使用メモリ 163,716 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-20 17:49:41
合計ジャッジ時間 2,909 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 2 ms
5,376 KB
testcase_13 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:8:19: warning: 'n' is used uninitialized [-Wuninitialized]
    8 |     vector<ll> f(n+1,0);
      |                  ~^~
main.cpp:7:8: note: 'n' declared here
    7 |     ll n;
      |        ^

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n;
    vector<ll> f(n+1,0);
    cin >> f[0] >> f[1] >> n;
    for(int i = 2; i <= n; i++) f[i] = f[i-1] ^ f[i-2];

    cout << f[n] << endl; 


    return 0;
}
0