結果

問題 No.2938 Sigma Sigma Distance Distance Problem
ユーザー moon17
提出日時 2024-10-18 22:31:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 61,796 KB
最終ジャッジ日時 2024-10-18 22:51:44
合計ジャッジ時間 1,960 ms
ジャッジサーバーID
(参考情報)
judge / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n,*a=map(int,open(0).read().split())
if not(1<=n<=100 and 1<=min(a)<=max(a)<=100):
  exit()
ans=0
for i in range(n):
  for j in range(n):
    ans+=abs(i-j)*abs(a[i]-a[j])
print(ans)
0