結果

問題 No.2235 Line Up Colored Balls
ユーザー t98slider
提出日時 2023-02-24 00:40:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 81,116 KB
最終ジャッジ日時 2024-09-18 01:08:44
合計ジャッジ時間 4,447 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = list(map(int, input().split()))

s, s1, mod = 0, 0, 1000000007
for v in x:
    s1 += s * v
    s += v

print((1 + 2 * s1 * pow(s, mod - 2, mod)) % mod)
0