結果

問題 No.64 XORフィボナッチ数列
ユーザー fumi6328fumi6328
提出日時 2018-10-06 12:32:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 261 bytes
コンパイル時間 1,817 ms
コンパイル使用メモリ 165,224 KB
実行使用メモリ 36,228 KB
最終ジャッジ日時 2023-08-02 17:41:48
合計ジャッジ時間 3,510 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
35,912 KB
testcase_01 AC 11 ms
35,812 KB
testcase_02 AC 11 ms
35,724 KB
testcase_03 AC 11 ms
35,604 KB
testcase_04 AC 11 ms
35,784 KB
testcase_05 AC 11 ms
35,756 KB
testcase_06 AC 11 ms
35,708 KB
testcase_07 AC 11 ms
35,740 KB
testcase_08 AC 11 ms
35,656 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 11 ms
35,708 KB
testcase_13 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:8:19: 警告: ‘n’ is used uninitialized [-Wuninitialized]
    8 |     vector<ll> f(n+1,0);
      |                  ~^~
main.cpp:7:8: 備考: ‘n’ はここで宣言されています
    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(ll i = 2; i <= n; i++) f[i] = f[i-1] ^ f[i-2];

    cout << f[n] << endl; 


    return 0;
}
0