結果

問題 No.954 Result
ユーザー face4face4
提出日時 2019-12-17 10:08:58
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 480 bytes
コンパイル時間 765 ms
コンパイル使用メモリ 71,488 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-21 12:56:55
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 WA -
testcase_35 AC 2 ms
4,384 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:19:23: 警告: ‘j’ may be used uninitialized [-Wmaybe-uninitialized]
   19 |         while(i+j < k && j < 5 && a[j]==v[i+j]) j++;
      |               ~~~~~~~~^~~~~~~~
main.cpp:18:13: 備考: ‘j’ はここで定義されています
   18 |         int j;
      |             ^

ソースコード

diff #

#include<iostream>
#include<vector>
using namespace std;

typedef long long ll;

int main(){
    ll a[5];
    for(int i = 4; i >= 0; i--) cin >> a[i];
    vector<ll> v({1, 1});
    int k = 2;
    while(v.back() <= 100000'00000'00000){
        v.push_back(v[k-1]+v[k-2]);
        k++;
    }
    int ans = 0;
    for(int i = 0; i < k; i++){
        int j;
        while(i+j < k && j < 5 && a[j]==v[i+j]) j++;
        ans = max(ans, j);
    }
    cout << ans << endl;
    return 0;
}
0