結果

問題 No.2275 →↑↓
ユーザー ks2mks2m
提出日時 2023-04-21 21:25:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 73,920 KB
実行使用メモリ 58,064 KB
最終ジャッジ日時 2024-04-24 07:35:24
合計ジャッジ時間 5,498 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
37,024 KB
testcase_01 AC 45 ms
36,956 KB
testcase_02 AC 47 ms
37,028 KB
testcase_03 AC 46 ms
36,940 KB
testcase_04 AC 48 ms
36,540 KB
testcase_05 AC 47 ms
37,084 KB
testcase_06 AC 320 ms
55,432 KB
testcase_07 AC 247 ms
53,860 KB
testcase_08 AC 288 ms
57,736 KB
testcase_09 AC 293 ms
57,676 KB
testcase_10 AC 291 ms
57,776 KB
testcase_11 AC 285 ms
58,064 KB
testcase_12 AC 286 ms
57,476 KB
testcase_13 AC 282 ms
57,612 KB
testcase_14 AC 283 ms
57,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] sa = br.readLine().split(" ");
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		int mod = 998244353;
		long ans = 1;
		for (int i = 1; i < n; i++) {
			int m = Math.min(a[i - 1], a[i]);
			ans *= m;
			ans %= mod;
		}
		System.out.println(ans);
	}
}
0