結果

問題 No.2600 Avator Height
ユーザー 👑 chro_96chro_96
提出日時 2024-01-12 23:03:36
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-12 23:03:41
合計ジャッジ時間 4,960 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main () {
  int q = 0;
  int n = 0;
  
  int res = 0;
  
  long long r[200000] = {};
  long long e[200000] = {};
  long long mod_num = 998244353LL;
  
  r[0] = 1LL;
  r[1] = 1LL;
  e[0] = 1LL;
  e[1] = 3LL;
  for (int i = 2; i < 200000; i++) {
    r[i] = (r[i-1]+r[i-2])%mod_num;
    e[i] = (e[i-1]+e[i-2])%mod_num;
  }
  
  res = scanf("%d", &q);
  while (q > 0) {
    long long ans = 0LL;
    res = scanf("%d", &n);
    ans = (r[n-1]*r[n-1])%mod_num;
    ans *= 5LL;
    ans += mod_num-(e[n-1]*e[n-1])%mod_num;
    printf("%lld\n", ans%mod_num);
    q--;
  }
  
  return 0;
}
0