結果

問題 No.2600 Avator Height
ユーザー aogeraaogera
提出日時 2024-04-03 22:34:36
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 1,922 bytes
コンパイル時間 8,618 ms
コンパイル使用メモリ 351,020 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-03 22:34:52
合計ジャッジ時間 13,983 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,676 KB
testcase_01 AC 45 ms
6,676 KB
testcase_02 AC 46 ms
6,676 KB
testcase_03 AC 46 ms
6,676 KB
testcase_04 AC 48 ms
6,676 KB
testcase_05 AC 47 ms
6,676 KB
testcase_06 AC 47 ms
6,676 KB
testcase_07 AC 48 ms
6,676 KB
testcase_08 AC 47 ms
6,676 KB
testcase_09 AC 48 ms
6,676 KB
testcase_10 AC 47 ms
6,676 KB
testcase_11 AC 42 ms
6,676 KB
testcase_12 AC 38 ms
6,676 KB
testcase_13 AC 38 ms
6,676 KB
testcase_14 AC 37 ms
6,676 KB
testcase_15 AC 37 ms
6,676 KB
testcase_16 AC 41 ms
6,676 KB
testcase_17 AC 50 ms
6,676 KB
testcase_18 AC 50 ms
6,676 KB
testcase_19 AC 45 ms
6,676 KB
testcase_20 AC 50 ms
6,676 KB
testcase_21 AC 48 ms
6,676 KB
testcase_22 AC 50 ms
6,676 KB
testcase_23 AC 50 ms
6,676 KB
testcase_24 AC 24 ms
6,676 KB
testcase_25 AC 34 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

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 vst = vector<string>;using ll = long long;
using ld = long double;using pll = pair<ll,ll>;using vll = vector<ll>;using vvll = vector<vll>;using vpl = vector<pll>;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repp(i,k,n) for (ll i = k; i < n; i++)
#define per(i,s,e) for(ll i = s; i >= e; i--)
#define all(v) v.begin(),v.end()
#define yesno(a) a ? cout << "Yes" << endl : cout << "No" << endl
#define YESNO(a) a ? cout << "YES" << endl : cout << "NO" << endl
#define UNOmap unordered_map
#define UNOset unordered_set
#define join(G,a,b) G[a].push_back(b);G[b].push_back(a);
#define PB(a,b) a.emplace_back(b)
template<class... T>void in(T&... a){(cin >> ... >> a);}
template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' <<  b), ...);cout << '\n';}
void vin(vll &v){for(ll i = 0; i < (ll)v.size(); i++)in(v[i]);}
void vout(vll &v){for(ll i = 0; i < (ll)v.size(); i++) cout << v[i] << ' ';cout << "\n";}
ll INF = 4611686018427387904;ll MOD9 =998244353; ll MOD1 =1000000007;
/* INF = 2^62 */
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
using mint9 = modint998244353;
using mint1 = modint1000000007;
using mint = modint;
//----------------------------------------------



int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  // cout << fixed << setprecision(15);
//==============================================
  vector<mint9> R(2e5+9);
  vector<mint9> E(2e5+9);
  
  R[1] = 1;
  R[2] = 1;
  E[1] = 1;
  E[2] = 3;
  
  repp(i,3,2e5+9){
    R[i] = R[i-1] + R[i-2];
    E[i] = E[i-1] + E[i-2];
  }
  
  ll Q;
  in(Q);
  rep(i,Q){
    ll N;
    in(N);
    mint9 ans = 0;
    ans = 5*R[N]*R[N] - E[N]*E[N];
    out(ans.val());
  }
  
}
0