Submission #1067339
Source Code Expand
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // 1行、2つ(複数)数字 String[] ss0 = br.readLine().trim().split(" ", 0); int N = Integer.parseInt(ss0[0]); int A = Integer.parseInt(ss0[1]); int B = Integer.parseInt(ss0[2]); // String[] X = br.readLine().trim().split(" ", 0); int sa = 0; float h = 0; for(int i = 0; (i+1) < N; i++){ sa = Integer.parseInt(X[i+1]) - Integer.parseInt(X[i]); if ( (sa * A) <= B ){ h = h + (sa * A); }else{ h = h + B; } } System.out.println((int)h); return; } // Debug.Print static void dp(String s) { System.out.println(s); } static void dp(StringBuilder s) { dp(s.toString()); } static void dp(int i) { dp(String.valueOf(i)); } static void dp(long i) { dp(String.valueOf(i)); } }
Submission Info
Submission Time | |
---|---|
Task | D - Walk and Teleport |
User | tnag |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 1049 Byte |
Status | WA |
Exec Time | 232 ms |
Memory | 25044 KB |
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 | 94 ms | 8144 KB |
sample_02.txt | AC | 95 ms | 8016 KB |
sample_03.txt | AC | 94 ms | 8148 KB |
subtask_1_balancedmax_01.txt | WA | 213 ms | 24396 KB |
subtask_1_balancedmax_02.txt | WA | 209 ms | 24400 KB |
subtask_1_max_01.txt | WA | 225 ms | 25036 KB |
subtask_1_max_02.txt | WA | 213 ms | 24396 KB |
subtask_1_min_01.txt | WA | 95 ms | 8144 KB |
subtask_1_onlya_01.txt | WA | 186 ms | 17700 KB |
subtask_1_onlyamax_01.txt | WA | 232 ms | 25044 KB |
subtask_1_onlyb_01.txt | WA | 160 ms | 14032 KB |
subtask_1_onlybmax_01.txt | WA | 212 ms | 24524 KB |
subtask_1_rand_01.txt | WA | 184 ms | 20692 KB |
subtask_1_rand_02.txt | WA | 205 ms | 22988 KB |
subtask_1_rand_03.txt | WA | 181 ms | 16788 KB |