結果

問題 No.2600 Avator Height
ユーザー momoyuumomoyuu
提出日時 2024-01-13 13:49:35
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 981 ms
コンパイル使用メモリ 102,864 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-13 13:49:47
合計ジャッジ時間 11,565 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 291 ms
6,676 KB
testcase_02 AC 278 ms
6,676 KB
testcase_03 AC 295 ms
6,676 KB
testcase_04 AC 293 ms
6,676 KB
testcase_05 AC 284 ms
6,676 KB
testcase_06 AC 289 ms
6,676 KB
testcase_07 AC 294 ms
6,676 KB
testcase_08 AC 290 ms
6,676 KB
testcase_09 AC 305 ms
6,676 KB
testcase_10 AC 290 ms
6,676 KB
testcase_11 AC 291 ms
6,676 KB
testcase_12 AC 287 ms
6,676 KB
testcase_13 AC 286 ms
6,676 KB
testcase_14 AC 301 ms
6,676 KB
testcase_15 AC 288 ms
6,676 KB
testcase_16 AC 290 ms
6,676 KB
testcase_17 AC 293 ms
6,676 KB
testcase_18 AC 293 ms
6,676 KB
testcase_19 AC 288 ms
6,676 KB
testcase_20 AC 289 ms
6,676 KB
testcase_21 AC 292 ms
6,676 KB
testcase_22 AC 295 ms
6,676 KB
testcase_23 AC 298 ms
6,676 KB
testcase_24 AC 268 ms
6,676 KB
testcase_25 AC 279 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;


#include<atcoder/modint>
using mint = atcoder::modint998244353;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int q;
    cin>>q;
    const int mx = 2e5;
    vector<mint> r(mx+1,1),e(mx+1,1);
    e[2] = 3;
    for(int i = 3;i<=mx;i++){
        r[i] = r[i-1] + r[i-2];
        e[i] = e[i-1] + e[i-2];
    }
    for(int i = 0;i<q;i++){
        int ni;
        cin>>ni;
        mint ans = mint(5)*r[ni]*r[ni] - e[ni]*e[ni];
        cout<<ans.val()<<endl;
    }
}

0