結果

問題 No.2600 Avator Height
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2024-01-12 21:54:46
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 333 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 3,058 ms
コンパイル使用メモリ 249,384 KB
実行使用メモリ 6,716 KB
最終ジャッジ日時 2024-01-12 21:55:06
合計ジャッジ時間 13,463 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
6,716 KB
testcase_01 AC 301 ms
6,716 KB
testcase_02 AC 301 ms
6,716 KB
testcase_03 AC 327 ms
6,716 KB
testcase_04 AC 302 ms
6,716 KB
testcase_05 AC 304 ms
6,716 KB
testcase_06 AC 329 ms
6,716 KB
testcase_07 AC 300 ms
6,716 KB
testcase_08 AC 305 ms
6,716 KB
testcase_09 AC 305 ms
6,716 KB
testcase_10 AC 301 ms
6,716 KB
testcase_11 AC 300 ms
6,716 KB
testcase_12 AC 299 ms
6,716 KB
testcase_13 AC 326 ms
6,716 KB
testcase_14 AC 305 ms
6,716 KB
testcase_15 AC 304 ms
6,716 KB
testcase_16 AC 302 ms
6,716 KB
testcase_17 AC 303 ms
6,716 KB
testcase_18 AC 301 ms
6,716 KB
testcase_19 AC 304 ms
6,716 KB
testcase_20 AC 333 ms
6,716 KB
testcase_21 AC 301 ms
6,716 KB
testcase_22 AC 302 ms
6,716 KB
testcase_23 AC 303 ms
6,716 KB
testcase_24 AC 271 ms
6,716 KB
testcase_25 AC 283 ms
6,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

const long long mod = 998244353;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
    vector<long long> R = {1,1};
    vector<long long> E = {1,3};

    for (int i = 0; i < 2e5; i++){
        R.push_back((R[1+i] + R[i]) % mod);
        E.push_back((E[1+i] + E[i]) % mod);
    }

    int q;
    cin >> q;

    for (int i = 0; i < q; i++){
        int n;
        cin >> n;
        n--;
        long long ans = (5 * R[n]*R[n] - E[n]*E[n])%mod;
        if (ans < 0) ans += mod;
        cout << ans << endl;
    }


    
    return 0;

}
0