6854 | 2023-12-19 12:22:48 | Spurr007 | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 3996 KiB |
#include <iostream>
using namespace std;
int main()
{
int a, b, c, sum=0, db=0;
cin>>a>>b>>c;
if((a+b+c)<10)
cout<<"-1";
else
{
while(db!=10)
{
if(a!=0)
{
a--;
sum=sum+300;
db++;
}
else if(b!=0)
{
b--;
sum=sum+350;
db++;
}
else if(c!=0)
{
c--;
sum=sum+400;
db++;
}
}
cout<<sum;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1748 KiB | ||||
2 | Accepted | 3ms | 1908 KiB | ||||
3 | Accepted | 3ms | 2436 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 3ms | 2660 KiB | ||||
5 | Accepted | 3ms | 2720 KiB | ||||
6 | Accepted | 3ms | 2800 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 3ms | 2936 KiB | ||||
8 | Accepted | 3ms | 3076 KiB | ||||
9 | Accepted | 3ms | 3008 KiB | ||||
10 | Accepted | 3ms | 3220 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 3ms | 3208 KiB | ||||
12 | Accepted | 2ms | 3256 KiB | ||||
13 | Accepted | 3ms | 3136 KiB | ||||
14 | Accepted | 3ms | 3388 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 3ms | 3632 KiB | ||||
16 | Accepted | 3ms | 3528 KiB | ||||
17 | Accepted | 3ms | 3520 KiB | ||||
18 | Accepted | 3ms | 3764 KiB | ||||
19 | Accepted | 3ms | 3864 KiB | ||||
20 | Accepted | 3ms | 3996 KiB |