Submission #2871646
Source Code Expand
import numpy as np def cnt(n, p): ct = 0 for i in range(1,n+1): for j in range(n-i+1): if p in range(j,j+i): ct+=1 return ct def sanc(ll): if len(ll) == 1: return ll[0] if len(ll) == 0: return 0 p = np.argmin(ll) n = len(ll) cc = cnt(n,p) return sanc(ll[:p]) + cc*ll[p] + sanc(ll[p+1:]) n=int(input()) a=np.array([int(x) for x in input().split()]) print(int(sanc(a)))
Submission Info
Submission Time | |
---|---|
Task | B - Minimum Sum |
User | kilattoeruru |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 416 Byte |
Status | TLE |
Exec Time | 2108 ms |
Memory | 34028 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2 |
All | corner0, corner1, corner2, corner3, example0, example1, example2, maxrand0, maxrand1, maxrand2, rand0, rand1, rand2 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
corner0 | TLE | 2108 ms | 34028 KB |
corner1 | TLE | 2108 ms | 34020 KB |
corner2 | AC | 150 ms | 12388 KB |
corner3 | TLE | 2108 ms | 33808 KB |
example0 | AC | 148 ms | 12388 KB |
example1 | AC | 149 ms | 12176 KB |
example2 | AC | 149 ms | 12388 KB |
maxrand0 | TLE | 2108 ms | 33808 KB |
maxrand1 | TLE | 2108 ms | 34016 KB |
maxrand2 | TLE | 2108 ms | 33812 KB |
rand0 | TLE | 2108 ms | 14420 KB |
rand1 | AC | 150 ms | 12388 KB |
rand2 | AC | 228 ms | 12388 KB |