Submission #1067317
Source Code Expand
#include <stdio.h> int main(void){ long long a, b, t = 0, walk; long long town[10001]; int i, n; scanf("%d %lld %lld", &n, &a, &b); for (i = 0; i < n; i++) scanf("%lld", &town[i]); for (i = 0; i < n-1; i++){ walk = a*(town[i+1] - town[i]); if (walk < b) t += walk; else t += b; } printf("%lld\n", t); return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Walk and Teleport |
User | Lemonmaru |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 363 Byte |
Status | RE |
Exec Time | 113 ms |
Memory | 256 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:8:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %lld %lld", &n, &a, &b); ^ ./Main.c:10:26: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] for (i = 0; i < n; i++) scanf("%lld", &town[i]); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
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 | 1 ms | 128 KB |
sample_02.txt | AC | 1 ms | 128 KB |
sample_03.txt | AC | 1 ms | 128 KB |
subtask_1_balancedmax_01.txt | RE | 111 ms | 256 KB |
subtask_1_balancedmax_02.txt | RE | 111 ms | 256 KB |
subtask_1_max_01.txt | RE | 112 ms | 256 KB |
subtask_1_max_02.txt | RE | 111 ms | 256 KB |
subtask_1_min_01.txt | AC | 1 ms | 128 KB |
subtask_1_onlya_01.txt | RE | 111 ms | 256 KB |
subtask_1_onlyamax_01.txt | RE | 111 ms | 256 KB |
subtask_1_onlyb_01.txt | RE | 111 ms | 256 KB |
subtask_1_onlybmax_01.txt | RE | 111 ms | 256 KB |
subtask_1_rand_01.txt | RE | 110 ms | 256 KB |
subtask_1_rand_02.txt | RE | 111 ms | 256 KB |
subtask_1_rand_03.txt | RE | 113 ms | 256 KB |