結果

問題 No.2275 →↑↓
ユーザー ああいいああいい
提出日時 2023-04-21 22:50:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 102,272 KB
最終ジャッジ日時 2024-04-24 08:53:55
合計ジャッジ時間 2,453 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 41 ms
51,456 KB
testcase_02 AC 41 ms
51,456 KB
testcase_03 AC 44 ms
51,968 KB
testcase_04 AC 41 ms
51,968 KB
testcase_05 AC 40 ms
51,712 KB
testcase_06 AC 92 ms
98,944 KB
testcase_07 AC 81 ms
89,472 KB
testcase_08 AC 113 ms
102,016 KB
testcase_09 AC 113 ms
101,888 KB
testcase_10 AC 112 ms
102,144 KB
testcase_11 AC 114 ms
101,888 KB
testcase_12 AC 112 ms
101,888 KB
testcase_13 AC 112 ms
102,272 KB
testcase_14 AC 113 ms
101,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
P = 998244353

now = 1
h = A[0] if A[0] <= A[1] else A[1]
for i in range(2,N):
    a = A[i-1]
    b = A[i]
    if b <= a:
        now = now * h % P
        h = b
    else:
        now = now * h % P
        h = a
print(now * h % P)
    
0