結果

問題 No.2600 Avator Height
ユーザー twooimp2twooimp2
提出日時 2024-03-03 19:21:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 715 bytes
コンパイル時間 6,636 ms
コンパイル使用メモリ 300,684 KB
実行使用メモリ 13,204 KB
最終ジャッジ日時 2024-03-03 19:21:59
合計ジャッジ時間 11,599 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
13,204 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;

void IO(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
}

int main(){
  IO();
  ll mod=998244353;
  vector<ll> r(2e5+1);
  r[1]=1;
  r[2]=1;
  for(ll i=3;i<=2e5;i++){
    r[i]=r[i-1]+r[i-2];
    r[i]%=mod;
  }
  vector<ll> e(2e5+1);
  e[1]=1;
  e[2]=3;
  for(ll i=3;i<=2e5;i++){
    e[i]=e[i-1]+e[i-2];
    e[i]%=mod;
  }
  ll q;
  cin>>q;
  for(ll i=0;i<q;i++){
    ll n;
    cin>>n;
    ll ans=5*r[n]*r[n]-e[n]*e[n];
    while(ans<0){
      ans+=mod;
    }
    ans%=mod;
    cout<<ans<<endl;
  }
}
0