結果

問題 No.2275 →↑↓
ユーザー kusagame12kusagame12
提出日時 2023-11-25 19:05:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 711 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 74,928 KB
実行使用メモリ 72,260 KB
最終ジャッジ日時 2023-11-25 19:05:57
合計ジャッジ時間 7,292 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
54,028 KB
testcase_01 AC 53 ms
53,996 KB
testcase_02 AC 51 ms
52,136 KB
testcase_03 AC 51 ms
52,032 KB
testcase_04 AC 51 ms
53,988 KB
testcase_05 AC 57 ms
54,008 KB
testcase_06 AC 318 ms
68,920 KB
testcase_07 AC 257 ms
67,432 KB
testcase_08 AC 295 ms
71,628 KB
testcase_09 AC 295 ms
71,460 KB
testcase_10 AC 329 ms
72,240 KB
testcase_11 AC 299 ms
72,096 KB
testcase_12 AC 297 ms
70,608 KB
testcase_13 AC 303 ms
71,976 KB
testcase_14 AC 324 ms
72,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] str = br.readLine().split(" ");
        int n = Integer.parseInt(str[0]);
        
        String[] as = br.readLine().split(" ");
        int[] aArr = new int[n];
        aArr[0] = Integer.parseInt(as[0]);
        long ans = 1;
        for(int i = 1 ; i < n ; i++){
            aArr[i] = Integer.parseInt(as[i]);
            int min = Math.min(aArr[i-1] , aArr[i]);
            ans *= min;
            ans %= 998244353;
        }
        
        System.out.println(ans);
        
    }

}
0