結果

問題 No.1765 While Shining
ユーザー cozy_saunacozy_sauna
提出日時 2022-03-10 17:37:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 866 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 106,440 KB
最終ジャッジ日時 2023-10-12 20:01:48
合計ジャッジ時間 4,342 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,480 KB
testcase_01 AC 76 ms
71,484 KB
testcase_02 AC 76 ms
71,300 KB
testcase_03 AC 75 ms
71,528 KB
testcase_04 AC 76 ms
71,348 KB
testcase_05 AC 77 ms
71,636 KB
testcase_06 AC 75 ms
71,528 KB
testcase_07 AC 74 ms
71,288 KB
testcase_08 AC 76 ms
71,292 KB
testcase_09 AC 103 ms
94,168 KB
testcase_10 AC 112 ms
105,864 KB
testcase_11 AC 106 ms
99,592 KB
testcase_12 AC 107 ms
102,956 KB
testcase_13 AC 106 ms
99,348 KB
testcase_14 AC 112 ms
106,364 KB
testcase_15 AC 113 ms
106,316 KB
testcase_16 AC 113 ms
106,320 KB
testcase_17 AC 112 ms
106,096 KB
testcase_18 AC 112 ms
106,288 KB
testcase_19 AC 115 ms
106,440 KB
testcase_20 AC 114 ms
106,288 KB
testcase_21 AC 113 ms
106,092 KB
testcase_22 AC 114 ms
106,144 KB
testcase_23 AC 114 ms
106,136 KB
testcase_24 AC 113 ms
106,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
M = [0] * 2
m, n = 0, 0
ans = 0
i = N - 1
for a in A[::-1]:
    ans += m * a * (~-i < N )
    m, n = n - n * a + 1, m * a + 1
    i -= 1
    
print(ans)
0