結果

問題 No.2938 Sigma Sigma Distance Distance Problem
ユーザー LyricalMaestroLyricalMaestro
提出日時 2024-10-20 23:24:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 61,176 KB
最終ジャッジ日時 2024-10-20 23:24:11
合計ジャッジ時間 4,833 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
59,020 KB
testcase_01 AC 35 ms
53,940 KB
testcase_02 AC 35 ms
52,108 KB
testcase_03 AC 43 ms
60,888 KB
testcase_04 AC 34 ms
52,880 KB
testcase_05 AC 35 ms
52,864 KB
testcase_06 AC 36 ms
52,280 KB
testcase_07 AC 40 ms
59,176 KB
testcase_08 AC 36 ms
52,960 KB
testcase_09 AC 36 ms
52,740 KB
testcase_10 AC 39 ms
58,724 KB
testcase_11 AC 39 ms
52,476 KB
testcase_12 AC 42 ms
60,248 KB
testcase_13 AC 44 ms
61,176 KB
testcase_14 AC 43 ms
60,316 KB
testcase_15 AC 42 ms
61,168 KB
testcase_16 AC 45 ms
60,924 KB
testcase_17 AC 39 ms
58,180 KB
testcase_18 AC 34 ms
52,676 KB
testcase_19 AC 39 ms
58,988 KB
testcase_20 AC 40 ms
59,412 KB
testcase_21 AC 50 ms
59,824 KB
04_evil.txt TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://yukicoder.me/problems/no/2938

def main():
    N = int(input())
    A = list(map(int, input().split()))

    answer = 0
    for i in range(N):
        for j in range(N):
            s = abs(i - j) * abs(A[i] - A[j])
            answer += s
    print(answer)















if __name__ == "__main__":
    main()
0