結果

問題 No.2600 Avator Height
ユーザー a01sa01to
提出日時 2024-01-14 01:24:43
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 383 ms / 2,000 ms
コード長 694 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 196,768 KB
最終ジャッジ日時 2025-02-18 19:55:12
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
  #include "settings/debug.cpp"
  #define _GLIBCXX_DEBUG
#else
  #define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

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

int main() {
  constexpr int sz = 2e5;
  vector<mint> r(sz), e(sz);
  r[0] = 1, e[0] = 1;
  r[1] = 1, e[1] = 3;
  rep(i, sz) {
    if (i < 2) continue;
    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;
    --n;
    cout << (5 * r[n] * r[n] - e[n] * e[n]).val() << endl;
  }
  return 0;
}
0