Submission #2461190
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int a[4];
int k;
bool cmp(int x ,int y)
{
return x < y;
}
int main()
{
scanf("%d %d %d",&a[1],&a[2],&a[3]);
scanf("%d",&k);
sort(a + 1,a + 1 + 3,cmp);
for(int i = 1;i <= k;i++)
{
a[3] *= 2;
}
printf("%d\n",a[1] + a[2] + a[3]);
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Maximum Sum |
| User | wifi_595 |
| Language | C++14 (GCC 5.4.1) |
| Score | 200 |
| Code Size | 329 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:14:37: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d %d",&a[1],&a[2],&a[3]);
^
./Main.cpp:15:16: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&k);
^
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 KiB |
| in02.txt | AC | 1 ms | 256 KiB |
| in03.txt | AC | 1 ms | 256 KiB |
| in04.txt | AC | 1 ms | 256 KiB |
| sample_01.txt | AC | 1 ms | 256 KiB |
| sample_02.txt | AC | 1 ms | 256 KiB |