Submission #870429
Source Code Expand
def solve(): n, x = map(int, input().split()) al = [int(i) for i in input().split()] bi = [i for i in al] ans = sum(al) for k in range(1, n): bi = [min(bi[i-1], al[i]) for i in range(n)] ans = min(ans, k * x + sum(bi)) print(ans) if __name__=="__main__": solve()
Submission Info
Submission Time | |
---|---|
Task | B - Colorful Slimes |
User | yumechi |
Language | PyPy3 (2.4.0) |
Score | 400 |
Code Size | 318 Byte |
Status | AC |
Exec Time | 586 ms |
Memory | 48732 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 385 ms | 43120 KB |
0_01.txt | AC | 378 ms | 42992 KB |
0_02.txt | AC | 375 ms | 42992 KB |
1_00.txt | AC | 537 ms | 48732 KB |
1_01.txt | AC | 512 ms | 47068 KB |
1_02.txt | AC | 497 ms | 47068 KB |
1_03.txt | AC | 518 ms | 47068 KB |
1_04.txt | AC | 513 ms | 47068 KB |
1_05.txt | AC | 519 ms | 47068 KB |
1_06.txt | AC | 579 ms | 47452 KB |
1_07.txt | AC | 579 ms | 47452 KB |
1_08.txt | AC | 581 ms | 47452 KB |
1_09.txt | AC | 586 ms | 47452 KB |
1_10.txt | AC | 545 ms | 47068 KB |
1_11.txt | AC | 522 ms | 47324 KB |
1_12.txt | AC | 494 ms | 47196 KB |
1_13.txt | AC | 508 ms | 47324 KB |
1_14.txt | AC | 568 ms | 47452 KB |
1_15.txt | AC | 521 ms | 47196 KB |
1_16.txt | AC | 543 ms | 47452 KB |
1_17.txt | AC | 566 ms | 47708 KB |