Submission #3017263


Source Code Expand

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();

        if (a <= b) {
            if (b <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*b+a+c));
            }
        } else {
            if (a <= c){
                System.out.println((int)(Math.pow(2,k)*c+a+b));
            } else {
                System.out.println((int)(Math.pow(2,k)*a+b+c));
            }

        }
    }
}

Submission Info

Submission Time
Task B - Maximum Sum
User ks96neko
Language Java7 (OpenJDK 1.7.0)
Score 200
Code Size 716 Byte
Status AC
Exec Time 97 ms
Memory 20820 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 6
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All in01.txt, in02.txt, in03.txt, in04.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
in01.txt AC 95 ms 19028 KB
in02.txt AC 94 ms 20820 KB
in03.txt AC 94 ms 18772 KB
in04.txt AC 97 ms 18772 KB
sample_01.txt AC 95 ms 20820 KB
sample_02.txt AC 95 ms 20820 KB