Submission #2464374


Source Code Expand

package main

import (
	"fmt"
)

func main() {
	var a, b, c, k int
	fmt.Scan(&a, &b, &c)
	fmt.Scan(&k)

	max := Max(a, b, c)
	total := a + b + c - max + max*Pow(2, k)

	fmt.Println(total)
}

func Max(as ...int) int {
	max := as[0]
	for _, a := range as {
		if max < a {
			max = a
		}
	}
	return max
}

func Pow(a, b int) int {
	pow := 1
	for i := 0; i < b; i++ {
		pow *= a
	}
	return pow
}

Submission Info

Submission Time
Task B - Maximum Sum
User rankey55
Language Go (1.6)
Score 200
Code Size 426 Byte
Status AC
Exec Time 1 ms
Memory 512 KiB

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 1 ms 512 KiB
in02.txt AC 1 ms 512 KiB
in03.txt AC 1 ms 512 KiB
in04.txt AC 1 ms 512 KiB
sample_01.txt AC 1 ms 512 KiB
sample_02.txt AC 1 ms 512 KiB