Submission #6445427
Source Code Expand
#sortすれば絶対値は外せる N=int(input()) cost=0 d=list(map(int,input().split())) d=sorted(d) for i in range(N): cost += (1+2*i-N)*d[i] print(cost)
Submission Info
Submission Time | |
---|---|
Task | C - Pair Distance |
User | koshin |
Language | Python (3.4.3) |
Score | 300 |
Code Size | 179 Byte |
Status | AC |
Exec Time | 107 ms |
Memory | 14092 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 21 ms | 3316 KiB |
02.txt | AC | 18 ms | 3188 KiB |
03.txt | AC | 20 ms | 3444 KiB |
04.txt | AC | 18 ms | 3060 KiB |
05.txt | AC | 17 ms | 3060 KiB |
06.txt | AC | 21 ms | 3572 KiB |
07.txt | AC | 20 ms | 3572 KiB |
08.txt | AC | 20 ms | 3572 KiB |
09.txt | AC | 21 ms | 3572 KiB |
10.txt | AC | 20 ms | 3572 KiB |
11.txt | AC | 99 ms | 13064 KiB |
12.txt | AC | 107 ms | 13780 KiB |
13.txt | AC | 103 ms | 13480 KiB |
14.txt | AC | 97 ms | 12956 KiB |
15.txt | AC | 98 ms | 13188 KiB |
16.txt | AC | 99 ms | 13464 KiB |
17.txt | AC | 104 ms | 14036 KiB |
18.txt | AC | 99 ms | 13340 KiB |
19.txt | AC | 102 ms | 13480 KiB |
20.txt | AC | 103 ms | 13396 KiB |
21.txt | AC | 100 ms | 13408 KiB |
22.txt | AC | 104 ms | 14092 KiB |
23.txt | AC | 103 ms | 13716 KiB |
24.txt | AC | 102 ms | 13588 KiB |
25.txt | AC | 100 ms | 13716 KiB |
s1.txt | AC | 17 ms | 2940 KiB |
s2.txt | AC | 17 ms | 2940 KiB |