結果

問題 No.2600 Avator Height
ユーザー tanaka255tanaka255
提出日時 2024-01-17 08:57:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 388 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 2,537 ms
コンパイル使用メモリ 201,680 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-17 08:57:22
合計ジャッジ時間 15,496 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 356 ms
6,676 KB
testcase_02 AC 387 ms
6,676 KB
testcase_03 AC 375 ms
6,676 KB
testcase_04 AC 388 ms
6,676 KB
testcase_05 AC 365 ms
6,676 KB
testcase_06 AC 358 ms
6,676 KB
testcase_07 AC 362 ms
6,676 KB
testcase_08 AC 366 ms
6,676 KB
testcase_09 AC 362 ms
6,676 KB
testcase_10 AC 375 ms
6,676 KB
testcase_11 AC 361 ms
6,676 KB
testcase_12 AC 364 ms
6,676 KB
testcase_13 AC 358 ms
6,676 KB
testcase_14 AC 362 ms
6,676 KB
testcase_15 AC 361 ms
6,676 KB
testcase_16 AC 358 ms
6,676 KB
testcase_17 AC 362 ms
6,676 KB
testcase_18 AC 364 ms
6,676 KB
testcase_19 AC 359 ms
6,676 KB
testcase_20 AC 368 ms
6,676 KB
testcase_21 AC 358 ms
6,676 KB
testcase_22 AC 361 ms
6,676 KB
testcase_23 AC 358 ms
6,676 KB
testcase_24 AC 312 ms
6,676 KB
testcase_25 AC 349 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include"atcoder/modint"
#include<bits/stdc++.h>
using namespace std;
using mint=atcoder::modint998244353;
int Q,N;
mint R[2<<17],E[2<<17];
int main(){
  R[1]=mint::raw(1);
  R[2]=mint::raw(1);
  E[1]=mint::raw(1);
  E[2]=mint::raw(3);
  for(int i=3;i<=200000;++i){
    R[i]=R[i-1]+R[i-2];
    E[i]=E[i-1]+E[i-2];
  }
  cin>>Q;
  while(Q--){
    cin>>N;
    mint ans=mint::raw(5)*R[N]*R[N]-E[N]*E[N];
    cout<<ans.val()<<'\n';
  }
}
0