Submission #2459828


Source Code Expand

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int a, b, c, k;
    cin >> a >> b >> c >> k;

    if(a > b && a > c){
        cout << b + c + a * pow(2, k) << endl;
        return 0;
    }

    if(b > a && b > c){
        cout << a + c + b * pow(2, k) << endl;
        return 0;
    }
    cout << a + b + c * pow(2, k) << endl;
    return 0;
}

Submission Info

Submission Time
Task B - Maximum Sum
User amanuko
Language C++14 (Clang 3.8.0)
Score 200
Code Size 682 Byte
Status AC
Exec Time 2 ms
Memory 384 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 2 ms 384 KB
in02.txt AC 1 ms 256 KB
in03.txt AC 1 ms 256 KB
in04.txt AC 1 ms 256 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB