結果

問題 No.2600 Avator Height
ユーザー hanagehanage
提出日時 2024-01-12 21:29:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 2,162 ms
コンパイル使用メモリ 205,144 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-12 21:30:17
合計ジャッジ時間 14,037 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 372 ms
6,676 KB
testcase_02 AC 345 ms
6,676 KB
testcase_03 AC 338 ms
6,676 KB
testcase_04 AC 372 ms
6,676 KB
testcase_05 AC 344 ms
6,676 KB
testcase_06 AC 352 ms
6,676 KB
testcase_07 AC 379 ms
6,676 KB
testcase_08 AC 353 ms
6,676 KB
testcase_09 AC 350 ms
6,676 KB
testcase_10 AC 377 ms
6,676 KB
testcase_11 AC 349 ms
6,676 KB
testcase_12 AC 354 ms
6,676 KB
testcase_13 AC 377 ms
6,676 KB
testcase_14 AC 345 ms
6,676 KB
testcase_15 AC 348 ms
6,676 KB
testcase_16 AC 378 ms
6,676 KB
testcase_17 AC 342 ms
6,676 KB
testcase_18 AC 337 ms
6,676 KB
testcase_19 AC 376 ms
6,676 KB
testcase_20 AC 343 ms
6,676 KB
testcase_21 AC 347 ms
6,676 KB
testcase_22 AC 368 ms
6,676 KB
testcase_23 AC 343 ms
6,676 KB
testcase_24 AC 304 ms
6,676 KB
testcase_25 AC 340 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/modint>
using namespace atcoder;
using mint = modint998244353;

int main() {
  vector<mint> R(200001), E(200001);
  R[1] = 1;
  R[2] = 1;
  E[1] = 1;
  E[2] = 3;
  for (int i = 3; i <= 200000; 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;
    mint ans = 5 * R[N] * R[N] - E[N] * E[N];
    cout << ans.val() << endl;
  }
  return 0;
}
0