結果
問題 | No.2275 →↑↓ |
ユーザー |
|
提出日時 | 2023-11-25 19:05:48 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 292 ms / 2,000 ms |
コード長 | 711 bytes |
コンパイル時間 | 3,457 ms |
コンパイル使用メモリ | 74,444 KB |
実行使用メモリ | 65,364 KB |
最終ジャッジ日時 | 2024-09-26 11:09:46 |
合計ジャッジ時間 | 6,701 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
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);}}