Submission #6300873


Source Code Expand

Copy
from scipy.sparse import csr_matrix
from scipy.sparse.linalg import spsolve
import numpy as np
N = int(input())
A = np.array(input().split())

rows = np.concatenate([np.arange(N), np.arange(N)])
cols = np.concatenate([np.arange(N), np.arange(1,N+1) % N])
mat = csr_matrix(([1] * (2*N), (rows, cols)), (N,N))

answer = (spsolve(mat,A) * 2 + .5).astype(int)
print(*answer)

Submission Info

Submission Time
Task D - Rain Flows into Dams
User maspy
Language Python (3.4.3)
Score 400
Code Size 381 Byte
Status AC
Exec Time 863 ms
Memory 67912 KB

Judge Result

Set Name All Sample
Score / Max Score 400 / 400 0 / 0
Status
AC × 18
AC × 3
Set Name Test Cases
All sample_01, sample_02, sample_03, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08, testcase_09, testcase_10, testcase_11, testcase_12, testcase_13, testcase_14, testcase_15
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
sample_01 AC 409 ms 25252 KB
sample_02 AC 223 ms 16548 KB
sample_03 AC 224 ms 16524 KB
testcase_01 AC 573 ms 44836 KB
testcase_02 AC 632 ms 50128 KB
testcase_03 AC 857 ms 65900 KB
testcase_04 AC 249 ms 18992 KB
testcase_05 AC 823 ms 65136 KB
testcase_06 AC 826 ms 65136 KB
testcase_07 AC 472 ms 36328 KB
testcase_08 AC 854 ms 65044 KB
testcase_09 AC 519 ms 40396 KB
testcase_10 AC 227 ms 16780 KB
testcase_11 AC 863 ms 67912 KB
testcase_12 AC 828 ms 66060 KB
testcase_13 AC 860 ms 65908 KB
testcase_14 AC 224 ms 16524 KB
testcase_15 AC 819 ms 62256 KB