結果

問題 No.2600 Avator Height
ユーザー zezerozezero
提出日時 2024-01-12 21:30:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 408 ms / 2,000 ms
コード長 827 bytes
コンパイル時間 3,114 ms
コンパイル使用メモリ 168,716 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-12 21:30:31
合計ジャッジ時間 14,642 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
6,676 KB
testcase_01 AC 376 ms
6,676 KB
testcase_02 AC 351 ms
6,676 KB
testcase_03 AC 351 ms
6,676 KB
testcase_04 AC 350 ms
6,676 KB
testcase_05 AC 351 ms
6,676 KB
testcase_06 AC 351 ms
6,676 KB
testcase_07 AC 346 ms
6,676 KB
testcase_08 AC 349 ms
6,676 KB
testcase_09 AC 356 ms
6,676 KB
testcase_10 AC 353 ms
6,676 KB
testcase_11 AC 351 ms
6,676 KB
testcase_12 AC 352 ms
6,676 KB
testcase_13 AC 352 ms
6,676 KB
testcase_14 AC 352 ms
6,676 KB
testcase_15 AC 408 ms
6,676 KB
testcase_16 AC 346 ms
6,676 KB
testcase_17 AC 348 ms
6,676 KB
testcase_18 AC 355 ms
6,676 KB
testcase_19 AC 346 ms
6,676 KB
testcase_20 AC 376 ms
6,676 KB
testcase_21 AC 346 ms
6,676 KB
testcase_22 AC 350 ms
6,676 KB
testcase_23 AC 352 ms
6,676 KB
testcase_24 AC 302 ms
6,676 KB
testcase_25 AC 365 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <stack>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)
using mint = modint998244353;
int main(){
  int q;
  cin >> q;
  vector<mint> r(200001);
  vector<mint> e(200001);
  for (int i = 1; i <= 200000;i++){
    if (i == 1) r[i] = 1;
    else if (i == 2) r[i] = 1;
    else r[i] = r[i-1] + r[i-2];
  }
  for (int i = 1; i <= 200000;i++){
    if (i == 1) e[i] = 1;
    else if (i == 2) e[i] = 3;
    else e[i] = e[i-1] + e[i-2];
  }
  while(q--){
    int n;
    cin >> n;
    cout << (mint(5)*r[n]*r[n]-e[n]*e[n]).val() << endl;
  }
  return 0;
}
0