6860 | 2023-12-19 12:36:16 | kboti | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 4484 KiB |
#include <iostream>
using namespace std;
int main() {
int a,b,c,n=10,k=0;
cin>>a>>b>>c;
if (a<n)
{
n=n-a;
k=k+a*300;
}
else
{
k=k+n*300;
n=0;
}
if (b<n)
{
n=n-b;
k=k+b*350;
}
else
{
k=k+n*350;
n=0;
}
if (c<n)
{
n=n-c;
k=k+c*400;
}
else
{
k=k+n*400;
n=0;
}
if (n>0)
k=-1;
cout<<k<<endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 2024 KiB | ||||
2 | Accepted | 3ms | 2264 KiB | ||||
3 | Accepted | 3ms | 2404 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 3ms | 2660 KiB | ||||
5 | Accepted | 3ms | 2900 KiB | ||||
6 | Accepted | 3ms | 3020 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 3ms | 3104 KiB | ||||
8 | Accepted | 3ms | 3340 KiB | ||||
9 | Accepted | 3ms | 3340 KiB | ||||
10 | Accepted | 3ms | 3476 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 3ms | 3552 KiB | ||||
12 | Accepted | 3ms | 3640 KiB | ||||
13 | Accepted | 3ms | 3548 KiB | ||||
14 | Accepted | 3ms | 3792 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 3ms | 4012 KiB | ||||
16 | Accepted | 3ms | 4016 KiB | ||||
17 | Accepted | 3ms | 4028 KiB | ||||
18 | Accepted | 3ms | 4296 KiB | ||||
19 | Accepted | 3ms | 4404 KiB | ||||
20 | Accepted | 3ms | 4484 KiB |