Submission #14808048


Source Code Expand

Copy
import sys
import numpy as np

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

def get_input():
    D = int(readline())
    C = np.array(readline().split(), np.int32)
    S = np.array([readline().split() for _ in range(D)], np.int32)
    T = np.array(read().split(), np.int32)
    T -= 1
    return D, C, S, T

def print_scores(D, C, S, T):
    x = 0
    last = np.zeros(26, np.int32)
    for d in range(D):
        i = T[d]
        x += S[d, i]
        last[i] = d + 1
        for i in range(26):
            x -= np.sum(C[i] * (d + 1 - last[i]))
        print(x)

D, C, S, T = get_input()
print_scores(D, C, S, T)

Submission Info

Submission Time
Task B - Scoring
User maspy
Language Python (3.8.2)
Score 1
Code Size 700 Byte
Status
Exec Time 261 ms
Memory 27572 KB

Judge Result

Set Name Score / Max Score Test Cases
test_ALL 1 / 1 test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt
Case Name Status Exec Time Memory
test_00.txt 261 ms 26940 KB
test_01.txt 224 ms 27364 KB
test_02.txt 226 ms 27572 KB
test_03.txt 219 ms 27264 KB
test_04.txt 213 ms 27060 KB