結果

問題 No.2600 Avator Height
ユーザー GlinTFrauleinGlinTFraulein
提出日時 2024-01-12 21:58:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 359 ms / 2,000 ms
コード長 1,805 bytes
コンパイル時間 4,292 ms
コンパイル使用メモリ 264,340 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-12 21:58:19
合計ジャッジ時間 15,775 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define elif else if
#define ll long long
#define vll vector<long long>
#define vec vector
#define embk emplace_back
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep3(i, n, k) for (ll i = k; i < n; i++)
#define all(a) a.begin(), a.end()
#define YNeos(bool) (bool ? "Yes" : "No")
#define vllin(a, n) vll a(n); rep(i, n) cin >> a[i]
#define vchin(a, n) vec<char> a(n); rep(i, n) cin >> a[i]


using namespace std;
const ll INF = 1LL << 60;
const ll mod = 998244353;
//const ll mod = 1000000007;
const double pi = acos(-1);

#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;


//Prototype declaration
template <class T, class... U> void gin(T&&, U&&...);
template <typename T> vector<T> read(ll);
template <typename T> void printvec(const T&);
template <class T, class... U> void printany(T&&, U&&...);

//Main Program
int main() {
  ll q; cin >> q;

  vec<mint> r(200010), e(200010);
  r[1] = 1; r[2] = 1;
  e[1] = 1; e[2] = 3;
  rep3(i, 200010, 3) {
    r[i] = r[i-1] + r[i-2];
    e[i] = e[i-1] + e[i-2];
  }

  rep(itr, q) {
    ll n; cin >> n;
    mint ans = 5 * r[n] * r[n] - e[n] * e[n];
    cout << ans.val() << endl;

  }

}


//Function Definition
void gin() {return;}
template <class T, class... U> void gin(T&& now,  U&&... next) {
  cin >> now;
  gin(forward<U> (next)...);
}

template <typename T> vector<T> read(ll n) {
  vector<T> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  return v;
}

template <typename T> void printvec(const T& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i];
    if (i == a.size() - 1) cout << endl;
    else cout << ' ';
  }
}

void printany() {cout << endl;}
template <class T, class... U> void printany(T&& now, U&&... next) {
  cout << now << ' ';
  printany(forward<U> (next)...);
}
0