結果

問題 No.2600 Avator Height
ユーザー nononnonon
提出日時 2024-01-12 21:25:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 321 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 2,251 ms
コンパイル使用メモリ 203,624 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-12 21:25:56
合計ジャッジ時間 12,046 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
const int M=2e5;
mint R[2<<17],E[2<<17];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    R[1]=R[2]=1;
    E[1]=1;
    E[2]=3;
    for(int i=3;i<=M;i++)
    {
        R[i]=R[i-1]+R[i-2];
        E[i]=E[i-1]+E[i-2];
    }
    int Q;
    cin>>Q;
    while(Q--)
    {
        int n;
        cin>>n;
        cout << (5*R[n]*R[n]-E[n]*E[n]).val() << endl;
    }
}
0