Submission #5443823


Source Code Expand

Copy
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int day = sc.nextInt();
        int k = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int sum = 0;
        
        if(day <= k){
            for(int i = 0;i < day;i++){
                sum += X;
            }
        }else{
            for(int i = 0;i < k;i++){
                sum += X;
            }
            for(int i = 0;i < day - k;i++){
                sum += Y;
            }
        }
        System.out.println(sum);
    }
}

Submission Info

Submission Time
Task A - 高橋君とホテルイージー / Tak and Hotels (ABC Edit)
User SuperQ
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 626 Byte
Status
Exec Time 94 ms
Memory 21204 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 92 ms 19796 KB
example_02.txt 91 ms 18644 KB
subtask1_01.txt 93 ms 19284 KB
subtask1_02.txt 93 ms 19284 KB
subtask1_03.txt 92 ms 19796 KB
subtask1_04.txt 92 ms 19796 KB
subtask1_05.txt 94 ms 18640 KB
subtask1_06.txt 92 ms 18640 KB
subtask1_07.txt 92 ms 18644 KB
subtask1_08.txt 92 ms 21204 KB