Submission #2211482
Source Code Expand
#include <stdio.h> int main(){ int n,i; long a,b,xb,xa,ans=0; for(i=0;i<n;i++){ if(i==0) scanf("%d",&xa); else{ xb=xa; scanf("%d",&xa); if((xa-xb)*a<b) ans+=(xa-xb)*a; else ans+=b; } } printf("%ld",ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Walk and Teleport |
User | torisasami |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 267 Byte |
Status | WA |
Exec Time | 0 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:7:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long int*’ [-Wformat=] scanf("%d",&xa); ^ ./Main.cpp:10:17: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long int*’ [-Wformat=] scanf("%d",&xa); ^ ./Main.cpp:7:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&xa); ^ ./Main.cpp:10:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&xa); ^
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 | sample_01.txt, sample_02.txt, sample_03.txt, 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 | WA | 0 ms | 128 KB |
sample_02.txt | WA | 0 ms | 128 KB |
sample_03.txt | WA | 0 ms | 128 KB |
subtask_1_balancedmax_01.txt | WA | 0 ms | 128 KB |
subtask_1_balancedmax_02.txt | WA | 0 ms | 128 KB |
subtask_1_max_01.txt | WA | 0 ms | 128 KB |
subtask_1_max_02.txt | WA | 0 ms | 128 KB |
subtask_1_min_01.txt | WA | 0 ms | 128 KB |
subtask_1_onlya_01.txt | WA | 0 ms | 128 KB |
subtask_1_onlyamax_01.txt | WA | 0 ms | 128 KB |
subtask_1_onlyb_01.txt | WA | 0 ms | 128 KB |
subtask_1_onlybmax_01.txt | WA | 0 ms | 128 KB |
subtask_1_rand_01.txt | WA | 0 ms | 128 KB |
subtask_1_rand_02.txt | WA | 0 ms | 128 KB |
subtask_1_rand_03.txt | WA | 0 ms | 128 KB |