結果
問題 | No.2600 Avator Height |
ユーザー |
|
提出日時 | 2024-01-12 21:54:46 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 301 ms / 2,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 2,609 ms |
コンパイル使用メモリ | 249,244 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-27 22:03:02 |
合計ジャッジ時間 | 12,377 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 |
ソースコード
#include<bits/stdc++.h>using namespace std;const long long mod = 998244353;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);vector<long long> R = {1,1};vector<long long> E = {1,3};for (int i = 0; i < 2e5; i++){R.push_back((R[1+i] + R[i]) % mod);E.push_back((E[1+i] + E[i]) % mod);}int q;cin >> q;for (int i = 0; i < q; i++){int n;cin >> n;n--;long long ans = (5 * R[n]*R[n] - E[n]*E[n])%mod;if (ans < 0) ans += mod;cout << ans << endl;}return 0;}