Submission #1065954


Source Code Expand

#!/usr/bin/env python


def read():
    N, A, B = map(int, raw_input().split())
    posList = map(int, raw_input().split())
    return A, B, posList


def work((A, B, posList)):
    ans = 0
    for i in range(len(posList) - 1):
        ans += min(A * (posList[i + 1] - posList[i]), B)
    print ans


if __name__ == "__main__":
    work(read())

Submission Info

Submission Time
Task D - Walk and Teleport
User Hachimori
Language Python (2.7.6)
Score 500
Code Size 363 Byte
Status AC
Exec Time 84 ms
Memory 11296 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 3
AC × 12
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All subtask_1_balancedmax_01.txt, subtask_1_balancedmax_02.txt, subtask_1_max_01.txt, subtask_1_max_02.txt, subtask_1_min_01.txt, subtask_1_onlya_01.txt, subtask_1_onlyamax_01.txt, subtask_1_onlyb_01.txt, subtask_1_onlybmax_01.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 15 ms 2568 KB
sample_02.txt AC 15 ms 2568 KB
sample_03.txt AC 15 ms 2568 KB
subtask_1_balancedmax_01.txt AC 84 ms 11296 KB
subtask_1_balancedmax_02.txt AC 84 ms 11296 KB
subtask_1_max_01.txt AC 83 ms 11296 KB
subtask_1_max_02.txt AC 82 ms 11296 KB
subtask_1_min_01.txt AC 15 ms 2568 KB
subtask_1_onlya_01.txt AC 50 ms 7028 KB
subtask_1_onlyamax_01.txt AC 84 ms 11284 KB
subtask_1_onlyb_01.txt AC 31 ms 4604 KB
subtask_1_onlybmax_01.txt AC 84 ms 11284 KB
subtask_1_rand_01.txt AC 58 ms 8068 KB
subtask_1_rand_02.txt AC 71 ms 9792 KB
subtask_1_rand_03.txt AC 39 ms 5764 KB