AtCoder Grand Contest 004

Submission #1357991

Source codeソースコード

def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(): return "".join(list(map(str, ans)))


N, x = rli()
a = rli()
ans = 2000000000001
magic_time = 0
s_min = a[:]
for i in range(0, N):
    for j in range(N):
        s_min[j] = min(a[j-i], s_min[j])
    ans = min(sum(s_min) + x*i, ans)
print(ans)

Submission

Task問題 B - Colorful Slimes
User nameユーザ名 AokabiC
Created time投稿日時
Language言語 Python3 (3.4.3)
Status状態 AC
Score得点 400
Source lengthソースコード長 382 Byte
File nameファイル名
Exec time実行時間 1662 ms
Memory usageメモリ使用量 3188 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - 0_00.txt,0_01.txt,0_02.txt
All 400 / 400 0_00.txt,0_01.txt,0_02.txt,1_00.txt,1_01.txt,1_02.txt,1_03.txt,1_04.txt,1_05.txt,1_06.txt,1_07.txt,1_08.txt,1_09.txt,1_10.txt,1_11.txt,1_12.txt,1_13.txt,1_14.txt,1_15.txt,1_16.txt,1_17.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
0_00.txt AC 17 ms 3060 KB
0_01.txt AC 17 ms 3064 KB
0_02.txt AC 17 ms 3060 KB
1_00.txt AC 1493 ms 3060 KB
1_01.txt AC 1662 ms 3064 KB
1_02.txt AC 1563 ms 3188 KB
1_03.txt AC 1498 ms 3188 KB
1_04.txt AC 1487 ms 3188 KB
1_05.txt AC 1481 ms 3188 KB
1_06.txt AC 1566 ms 3188 KB
1_07.txt AC 1562 ms 3188 KB
1_08.txt AC 1557 ms 3188 KB
1_09.txt AC 1530 ms 3188 KB
1_10.txt AC 1092 ms 3188 KB
1_11.txt AC 1521 ms 3188 KB
1_12.txt AC 1484 ms 3188 KB
1_13.txt AC 923 ms 3188 KB
1_14.txt AC 1512 ms 3188 KB
1_15.txt AC 1145 ms 3188 KB
1_16.txt AC 1308 ms 3188 KB
1_17.txt AC 1495 ms 3188 KB