Submission #5997607
Source Code Expand
/* include */
#include <bits/stdc++.h>
/* using */
using namespace std;
/* main constructor */
struct Fast
{
Fast()
{
std::cin.tie(0);
ios::sync_with_stdio(0);
//cout << fixed << setprecision(12);
}
} fast;
/* template */
template <class T>
bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; }
template <class T>
bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; }
/* define */
#define REP(i, x, n) for (int i = x; i < (int)(n); ++i)
#define RREP(i, x, n) for (int i = x - 1; i >= (int)(n); --i)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) REP(i, 1, n + 1)
#define rrep(i, n) RREP(i, n, 0)
#define each(i, n) for (auto &i : n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define eunique(x) \
sort(all(x)); \
(x).erase(unique(all(x)), (x).end())
#define mp make_pair
#define r0 return 0
/* const */
const int inf = 1e9 + 7;
const int dxl[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dyl[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dxs[4] = {1, 0, -1, 0};
const int dys[4] = {0, 1, 0, -1};
/* main */
signed main(void)
{
int a, b, c, k;
cin >> a >> b >> c >> k;
int maxi = max({a, b, c});
int sum = (a + b + c) - maxi;
rep(i, k)
{
maxi *= 2;
}
cout << sum + maxi << endl;
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Maximum Sum |
User |
kaoru1012 |
Language |
C++14 (GCC 5.4.1) |
Score |
200 |
Code Size |
1344 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
256 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
200 / 200 |
Status |
|
|
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 |
256 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 |