Submission #961003


Source Code Expand

import sys
import math

line = sys.stdin.readline()
(N, K) = map(int, line.split())

line = sys.stdin.readline()
a = [i for i in map(int, line.split())]
total = 0
total1 = 0
total2 = 0
total3 = 0

L = N - K
for i in range(0, L):
    total1 += a[i] * (i + 1)

for i in range(N - L, N):
    total3 += a[i] * (N - i)

for i in range(L, N - L):
    total2 += a[i]

total2 *= max(L + 1, 0)

total = 0
total += total1
total += total2
total += total3

print(total)

Submission Info

Submission Time
Task C - 総和
User toufu12345
Language Python (3.4.3)
Score 0
Code Size 487 Byte
Status WA
Exec Time 112 ms
Memory 15304 KiB

Judge Result

Set Name sample subtask1 subtask2
Score / Max Score 0 / 0 0 / 50 0 / 50
Status
AC × 2
AC × 9
WA × 4
AC × 15
WA × 7
Set Name Test Cases
sample sample01.txt, sample02.txt
subtask1 00.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample01.txt, sample02.txt
subtask2 00.txt, 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, sample01.txt, sample02.txt
Case Name Status Exec Time Memory
00.txt AC 22 ms 3064 KiB
01.txt WA 23 ms 3064 KiB
02.txt AC 23 ms 3064 KiB
03.txt AC 23 ms 3188 KiB
04.txt WA 23 ms 3188 KiB
05.txt WA 23 ms 3188 KiB
06.txt WA 23 ms 3188 KiB
07.txt AC 23 ms 3188 KiB
08.txt AC 23 ms 3188 KiB
09.txt AC 23 ms 3188 KiB
10.txt AC 23 ms 3188 KiB
11.txt WA 112 ms 14980 KiB
12.txt WA 105 ms 14984 KiB
13.txt AC 88 ms 14980 KiB
14.txt AC 80 ms 14980 KiB
15.txt AC 75 ms 14980 KiB
16.txt AC 76 ms 14980 KiB
17.txt AC 84 ms 15304 KiB
18.txt WA 81 ms 4904 KiB
19.txt AC 79 ms 15208 KiB
sample01.txt AC 23 ms 3192 KiB
sample02.txt AC 22 ms 3064 KiB