結果

問題 No.2275 →↑↓
ユーザー FromBooskaFromBooska
提出日時 2023-10-18 12:03:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 1,393 ms
コンパイル使用メモリ 81,288 KB
実行使用メモリ 101,532 KB
最終ジャッジ日時 2023-10-18 12:03:52
合計ジャッジ時間 2,939 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,220 KB
testcase_01 AC 38 ms
53,220 KB
testcase_02 AC 37 ms
53,220 KB
testcase_03 AC 37 ms
53,220 KB
testcase_04 AC 39 ms
53,220 KB
testcase_05 AC 37 ms
53,220 KB
testcase_06 AC 84 ms
98,212 KB
testcase_07 AC 70 ms
89,316 KB
testcase_08 AC 99 ms
101,148 KB
testcase_09 AC 100 ms
101,148 KB
testcase_10 AC 99 ms
101,532 KB
testcase_11 AC 104 ms
101,448 KB
testcase_12 AC 98 ms
101,148 KB
testcase_13 AC 100 ms
101,148 KB
testcase_14 AC 99 ms
101,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# BFS distanceではうまくいかない、隣り合うマスで交互に移動があるから
# A = [3, 5, 2]を考えると1行目はすべて1、2行目はすべて3、3行目はすべて6となる(min(2行目の列数、3行目の列数)の上列の和)

N = int(input())
A = list(map(int, input().split()))
mod = 998244353
for i in range(N):
    a = A[i]
    if i == 0:
        num = 1
    else:
        mn = min(A[i-1], A[i])
        num = num*mn
        num %= mod
    #print('i', i, 'num', num)
    
ans = num
print(ans)
0