Submission #5443711


Source Code Expand

Copy
import java.io.*;

public class Main {
    public static void main(String[] args)throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        int K = Integer.parseInt(br.readLine());
        int X = Integer.parseInt(br.readLine());
        int Y = Integer.parseInt(br.readLine());

        int in = 0;
        int out = 0;
        in = X*K;
        out = Y*(N-K);
        if(out <= 0){
            out = 0;
            in = X*N;
        }
        System.out.println(in+out);
    }
}

Submission Info

Submission Time
Task A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
User Yuzu82
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 601 Byte
Status
Exec Time 70 ms
Memory 23124 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_01.txt, example_02.txt
All 100 / 100 example_01.txt, example_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt
Case Name Status Exec Time Memory
example_01.txt 70 ms 21076 KB
example_02.txt 70 ms 20564 KB
subtask1_01.txt 68 ms 18388 KB
subtask1_02.txt 70 ms 18388 KB
subtask1_03.txt 69 ms 23124 KB
subtask1_04.txt 68 ms 19796 KB
subtask1_05.txt 69 ms 19156 KB
subtask1_06.txt 68 ms 18260 KB
subtask1_07.txt 70 ms 19028 KB
subtask1_08.txt 69 ms 20948 KB