6784 | 2023-12-19 09:54:04 | turitamas | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 4108 KiB |
#include <iostream>
using namespace std;
int main()
{
int a, b, c, x=0;
int fizetes=0;
cin>>a>>b>>c;
if(a+b+c<10)
{
cout<<"-1";
}
else if(a+b+c>=10)
{
for(int i=a; i>0; i--)
{
if(x!=10)
{
fizetes+=300;
x++;
}
else
break;
}
for(int i=b; i>0; i--)
{
if(x!=10)
{
fizetes+=350;
x++;
}
else
break;
}
for(int i=c; i>0; i--)
{
if(x!=10)
{
fizetes+=400;
x++;
}
else
break;
}
cout<<fizetes;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1752 KiB | ||||
2 | Accepted | 3ms | 1908 KiB | ||||
3 | Accepted | 3ms | 2160 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 3ms | 2368 KiB | ||||
5 | Accepted | 3ms | 2624 KiB | ||||
6 | Accepted | 3ms | 2824 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 3ms | 3040 KiB | ||||
8 | Accepted | 3ms | 3256 KiB | ||||
9 | Accepted | 3ms | 3300 KiB | ||||
10 | Accepted | 3ms | 3512 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 3ms | 3576 KiB | ||||
12 | Accepted | 3ms | 3572 KiB | ||||
13 | Accepted | 3ms | 3692 KiB | ||||
14 | Accepted | 3ms | 3580 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 3ms | 3856 KiB | ||||
16 | Accepted | 3ms | 4016 KiB | ||||
17 | Accepted | 3ms | 4036 KiB | ||||
18 | Accepted | 3ms | 4008 KiB | ||||
19 | Accepted | 3ms | 4108 KiB | ||||
20 | Accepted | 3ms | 4028 KiB |