Submission #2462503
Source Code Expand
#include <stdio.h> int main(void){ int a,b,c,k; int i; int tmp; scanf("%d %d %d",&a,&b,&c); scanf("%d",&k); /* Maximize A */ if( b < c ){ if( a < c ){ tmp = c; c = a; a = tmp; } } else{ // b > c if( a < b ){ tmp = b; b = a; a = tmp; } } //printf("A B C --(sort)--> %d %d %d\n",a,b,c); for( i=0; i<k; i++) a *= 2; printf("%d\n",a+b+c); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Maximum Sum |
User | bird_bird_bird |
Language | C (GCC 5.4.1) |
Score | 200 |
Code Size | 498 Byte |
Status | AC |
Exec Time | 0 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:8:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d %d",&a,&b,&c); ^ ./Main.c:9:3: warning: ignoring return value of ‘scanf’, 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 | 0 ms | 128 KB |
in02.txt | AC | 0 ms | 128 KB |
in03.txt | AC | 0 ms | 128 KB |
in04.txt | AC | 0 ms | 128 KB |
sample_01.txt | AC | 0 ms | 128 KB |
sample_02.txt | AC | 0 ms | 128 KB |