結果

問題 No.2275 →↑↓
ユーザー 👑 chro_96chro_96
提出日時 2023-04-21 21:25:50
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 07:35:05
合計ジャッジ時間 1,167 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 22 ms
5,376 KB
testcase_07 AC 17 ms
5,376 KB
testcase_08 AC 25 ms
5,376 KB
testcase_09 AC 25 ms
5,376 KB
testcase_10 AC 25 ms
5,376 KB
testcase_11 AC 25 ms
5,376 KB
testcase_12 AC 25 ms
5,376 KB
testcase_13 AC 25 ms
5,376 KB
testcase_14 AC 25 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int n = 0;
  long long a = 0LL;
  
  int res = 0;
  
  long long ans = 1LL;
  long long mod_num = 998244353LL;
  
  long long prev = 0LL;
  
  res = scanf("%d", &n);
  res = scanf("%lld", &a);
  prev = a;
  for (int i = 1; i < n; i++) {
    res = scanf("%lld", &a);
    if (a > prev) {
      ans *= prev;
      ans %= mod_num;
    } else {
      ans *= a;
      ans %= mod_num;
    }
    prev = a;
  }
  
  printf("%lld\n", ans);
  return 0;
}
0