Submission #10002355


Source Code Expand

Copy
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

data = np.fromstring(read(), np.int64, sep=' ')

N, K  = data[:2]
P = data[2:] + 1

Pcum = np.zeros(N + 1, np.int32)
Pcum[1:] = P.cumsum()

length_K_sums = Pcum[K:] - Pcum[0:-K]
print(length_K_sums.max() / 2)

Submission Info

Submission Time
Task D - Dice in Line
User maspy
Language Python3 (3.4.3)
Score 400
Code Size 361 Byte
Status
Exec Time 158 ms
Memory 18220 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 01.txt, 02.txt, 03.txt
All 400 / 400 01.txt, 02.txt, 03.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt
Case Name Status Exec Time Memory
01.txt 147 ms 12428 KB
02.txt 146 ms 12472 KB
03.txt 146 ms 12428 KB
10.txt 157 ms 18176 KB
11.txt 156 ms 18036 KB
12.txt 156 ms 17900 KB
13.txt 157 ms 18220 KB
14.txt 157 ms 17900 KB
15.txt 146 ms 12428 KB
16.txt 146 ms 12428 KB
17.txt 148 ms 12428 KB
18.txt 157 ms 18176 KB
19.txt 158 ms 18176 KB
20.txt 156 ms 17832 KB