1901 | 2022-12-08 10:24:57 | szabel26 | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 4372 KiB |
/*
Kodkupa - Bevasarlas 2022 Online Selejtezo
Megoldas: O(n)
Alapotlet:
*/
#include <iostream>
using namespace std;
int i,a,b,c,ap,bp,cp,p,db;
int main()
{
cin>>a>>b>>c;
if (a+b+c>=10)
{
for(i=1;i<=a;++i)
if(db<10){
++db;
++ap;
}
else break;
for(i=1;i<=b;++i)
if(db<10){
++db;
++bp;
}
else break;
for(i=1;i<=c;++i)
if(db<10){
++db;
++cp;
}
else break;
p=ap*300+bp*350+cp*400;
cout<<p;
}
else cout<<"-1";
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1876 KiB | ||||
2 | Accepted | 2ms | 2124 KiB | ||||
3 | Accepted | 2ms | 2364 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 2ms | 2376 KiB | ||||
5 | Accepted | 2ms | 2592 KiB | ||||
6 | Accepted | 2ms | 2672 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 2ms | 2908 KiB | ||||
8 | Accepted | 2ms | 3092 KiB | ||||
9 | Accepted | 2ms | 3344 KiB | ||||
10 | Accepted | 2ms | 3348 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 2ms | 3468 KiB | ||||
12 | Accepted | 2ms | 3588 KiB | ||||
13 | Accepted | 2ms | 3796 KiB | ||||
14 | Accepted | 2ms | 3996 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 2ms | 4204 KiB | ||||
16 | Accepted | 2ms | 4132 KiB | ||||
17 | Accepted | 2ms | 4244 KiB | ||||
18 | Accepted | 2ms | 4240 KiB | ||||
19 | Accepted | 2ms | 4372 KiB | ||||
20 | Accepted | 2ms | 4336 KiB |