6810 | 2023-12-19 10:30:43 | HunMartin23 | Bevásárlás | cpp17 | Wrong answer 0/100 | 3ms | 3348 KiB |
#include <iostream>
using namespace std;
int main()
{
int A,B,C,o=0;
cin>>A>>B>>C;
if(A+B+C!=10)
{
cout<<-1;
}
else if (A>=10)
{
cout<<10*300;
}
else if(A+B>=10)
{
switch (A)
{
case 1: cout<<1*300+9*350;
break;
case 2: cout<<2*300+8*350;
break;
case 3: cout<<3*300+7*350;
break;
case 4: cout<<4*300+6*350;
break;
case 5: cout<<5*300+5*350;
break;
case 6: cout<<6*300+4*350;
break;
case 7: cout<<7*300+3*350;
break;
case 8: cout<<8*300+2*350;
break;
case 9: cout<<9*300+1*350;
break;
case 0: cout<<0*300+10*350;
break;
}
}
else if(A+B+C>=10)
{
switch(A)
{
case 1: switch(B)
{
case 1:cout<<300*1+1*350+8*400 ;
break;
case 2:cout<<300*1+2*350+7*400 ;
break;
case 3:cout<<300*1+3*350+6*400 ;
break;
case 4:cout<<300*1+4*350+5*400 ;
break;
case 5:cout<<300*1+5*350+4*400 ;
break;
case 6:cout<<300*1+6*350+3*400 ;
break;
case 7:cout<<300*1+7*350+2*400 ;
break;
case 8:cout<<300*1+8*350+1*400 ;
break;
case 9:cout<<300*1+9*350+8*400 ;
break;
};
break;
case 2: switch(B)
{
case 1:cout<<300*2+1*350+7*400 ;
break;
case 2:cout<<300*2+2*350+6*400 ;
break;
case 3:cout<<300*2+3*350+5*400 ;
break;
case 4:cout<<300*2+4*350+4*400 ;
break;
case 5:cout<<300*2+5*350+3*400 ;
break;
case 6:cout<<300*2+6*350+2*400 ;
break;
case 7:cout<<300*2+7*350+1*400 ;
break;
};
break;
case 3: switch(B)
{
case 1:cout<<300*3+1*350+6*400 ;
break;
case 2:cout<<300*3+2*350+5*400 ;
break;
case 3:cout<<300*3+3*350+4*400 ;
break;
case 4:cout<<300*3+4*350+3*400 ;
break;
case 5:cout<<300*3+5*350+2*400 ;
break;
case 6:cout<<300*3+6*350+1*400 ;
break;}
break; ;
case 4:switch(B)
{
case 1:cout<<300*4+1*350+5*400 ;
break;
case 2:cout<<300*4+2*350+4*400 ;
break;
case 3:cout<<300*4+3*350+3*400 ;
break;
case 4:cout<<300*4+4*350+2*400 ;
break;
case 5:cout<<300*4+5*350+7*400 ;
break;}
break;
case 5:switch(B)
{
case 1:cout<<300*5+1*350+4*400 ;
break;
case 2:cout<<300*5+2*350+3*400 ;
break;
case 3:cout<<300*5+3*350+2*400 ;
break;
case 4:cout<<300*5+4*350+1*400 ;
break;}
break;
case 6:switch(B)
{
case 1:cout<<300*6+1*350+3*400 ;
break;
case 2:cout<<300*6+2*350+2*400 ;
break;
case 3:cout<<300*6+3*350+1*400 ;
break; }
break;
case 7:switch(B)
{
case 1:cout<<300*7+1*350+2*400 ;
break;
case 2:cout<<300*7+2*350+1*400 ;
break; }
break;
case 8: switch(B)
{
case 1:cout<<300*8+1*350+1*400 ;
break;}
break;
}
}
else if(B+C>=10)
{
switch(B)
{case 1:cout<<1*350+9*400;
break;
case 2: cout<<2*350+8*400 ;
break;
case 3: cout<<3*350+7*400 ;
break;
case 4: cout<<4*350+6*400 ;
break;
case 5: cout<<5*350+5*400 ;
break;
case 6: cout<<6*350+4*400 ;
break;
case 7: cout<<7*350+3*400 ;
break;
case 8: cout<<8*350+2*400 ;
break;
case 9: cout<<9*350+1*400 ;
break;
case 0: cout<<10*350+0*400;
break;}
}
else if(C>=10)
{
cout<<10*400;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1872 KiB | ||||
2 | Accepted | 3ms | 2124 KiB | ||||
3 | Wrong answer | 3ms | 2300 KiB | ||||
subtask2 | 0/10 | ||||||
4 | Wrong answer | 3ms | 2416 KiB | ||||
5 | Wrong answer | 3ms | 2632 KiB | ||||
6 | Wrong answer | 3ms | 2860 KiB | ||||
subtask3 | 0/20 | ||||||
7 | Wrong answer | 3ms | 2948 KiB | ||||
8 | Wrong answer | 3ms | 2848 KiB | ||||
9 | Accepted | 3ms | 2792 KiB | ||||
10 | Accepted | 3ms | 2852 KiB | ||||
subtask4 | 0/30 | ||||||
11 | Wrong answer | 3ms | 2968 KiB | ||||
12 | Wrong answer | 3ms | 2888 KiB | ||||
13 | Wrong answer | 3ms | 2868 KiB | ||||
14 | Wrong answer | 3ms | 2872 KiB | ||||
subtask5 | 0/40 | ||||||
15 | Wrong answer | 3ms | 3100 KiB | ||||
16 | Accepted | 3ms | 3076 KiB | ||||
17 | Accepted | 3ms | 3204 KiB | ||||
18 | Accepted | 3ms | 3216 KiB | ||||
19 | Wrong answer | 3ms | 3224 KiB | ||||
20 | Wrong answer | 3ms | 3348 KiB |