結果
問題 | No.2938 Sigma Sigma Distance Distance Problem |
ユーザー | katonyonko |
提出日時 | 2024-10-18 21:31:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 1,288 bytes |
コンパイル時間 | 533 ms |
コンパイル使用メモリ | 82,408 KB |
実行使用メモリ | 63,708 KB |
最終ジャッジ日時 | 2024-10-18 22:13:43 |
合計ジャッジ時間 | 3,730 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
55,132 KB |
testcase_01 | AC | 42 ms
55,332 KB |
testcase_02 | AC | 42 ms
55,048 KB |
testcase_03 | AC | 51 ms
63,404 KB |
testcase_04 | AC | 43 ms
56,120 KB |
testcase_05 | AC | 42 ms
55,236 KB |
testcase_06 | AC | 44 ms
54,924 KB |
testcase_07 | AC | 48 ms
61,188 KB |
testcase_08 | AC | 44 ms
55,644 KB |
testcase_09 | AC | 43 ms
55,672 KB |
testcase_10 | AC | 47 ms
61,400 KB |
testcase_11 | AC | 42 ms
55,576 KB |
testcase_12 | AC | 48 ms
62,568 KB |
testcase_13 | AC | 51 ms
63,600 KB |
testcase_14 | AC | 49 ms
62,852 KB |
testcase_15 | AC | 50 ms
63,328 KB |
testcase_16 | AC | 51 ms
63,708 KB |
testcase_17 | AC | 47 ms
62,292 KB |
testcase_18 | AC | 42 ms
55,044 KB |
testcase_19 | AC | 46 ms
62,864 KB |
testcase_20 | AC | 48 ms
61,988 KB |
testcase_21 | AC | 49 ms
63,568 KB |
04_evil_01.txt | WA | - |
04_evil_02.txt | WA | - |
04_evil_03.txt | WA | - |
04_evil_04.txt | WA | - |
04_evil_05.txt | WA | - |
04_evil_06.txt | WA | - |
04_evil_07.txt | WA | - |
04_evil_08.txt | WA | - |
04_evil_09.txt | WA | - |
04_evil_10.txt | WA | - |
04_evil_11.txt | WA | - |
04_evil_12.txt | WA | - |
04_evil_13.txt | WA | - |
04_evil_14.txt | WA | - |
04_evil_15.txt | WA | - |
04_evil_16.txt | WA | - |
04_evil_17.txt | WA | - |
04_evil_18.txt | WA | - |
04_evil_19.txt | WA | - |
04_evil_20.txt | WA | - |
ソースコード
import io import sys from collections import defaultdict, deque, Counter from itertools import permutations, combinations, accumulate from heapq import heappush, heappop from bisect import bisect_right, bisect_left from math import gcd import math _INPUT = """\ 6 2 3 2 3 1 2 3 9 41 15 76 69 70 58 10 20 34 """ def input(): return sys.stdin.readline()[:-1] def solve(test): N=int(input()) if N>100: exit() A=list(map(int, input().split())) ans=0 for i in range(N): for j in range(N): ans+=abs(i-j)*abs(A[i]-A[j]) print(ans) def random_input(): from random import randint,shuffle N=randint(1,10) M=randint(1,N) A=list(range(1,M+1))+[randint(1,M) for _ in range(N-M)] shuffle(A) return (" ".join(map(str, [N,M]))+"\n"+" ".join(map(str, A))+"\n")*3 def simple_solve(): return [] def main(test): if test==0: solve(0) elif test==1: sys.stdin = io.StringIO(_INPUT) case_no=int(input()) for _ in range(case_no): solve(0) else: for i in range(1000): sys.stdin = io.StringIO(random_input()) x=solve(1) y=simple_solve() if x!=y: print(i,x,y) print(*[line for line in sys.stdin],sep='') break #0:提出用、1:与えられたテスト用、2:ストレステスト用 main(0)