Submission #2550701
Source Code Expand
#include <cstdio> #include <algorithm> using namespace std; int main() { int a,b,c,x,y; scanf("%d %d %d %d %d",&a,&b,&c,&x,&y); int m1=a*x+b*y; int m2; if(x<y) { m2=2*x*c; if(y-x>=0) m2+=(y-x)*b; } int m3=0; if(y<x) { m3=2*y*c; if(y-x<0) m3+=(x-y)*a; } printf("%d",min(min(m1,m2),m3)); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Half and Half |
User | AboveTheHorizon |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 433 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:43: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d %d %d %d",&a,&b,&c,&x,&y); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | a01, a02, a03 |
All | a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
a01 | WA | 1 ms | 128 KB |
a02 | WA | 1 ms | 128 KB |
a03 | WA | 0 ms | 128 KB |
b04 | WA | 1 ms | 128 KB |
b05 | WA | 1 ms | 128 KB |
b06 | WA | 1 ms | 128 KB |
b07 | WA | 0 ms | 128 KB |
b08 | WA | 1 ms | 128 KB |
b09 | WA | 1 ms | 128 KB |
b10 | WA | 1 ms | 128 KB |
b11 | WA | 1 ms | 128 KB |
b12 | WA | 1 ms | 128 KB |
b13 | WA | 1 ms | 128 KB |
b14 | WA | 1 ms | 128 KB |
b15 | WA | 1 ms | 128 KB |