1631 | 2022-11-30 17:18:50 | levente19 | Bevásárlás | cpp11 | Accepted 100/100 | 3ms | 3816 KiB |
#include <bits/stdc++.h>
#define speed ios::sync_with_stdio(0);cin.tie(0)
using namespace std;
int main()
{
speed;
int alm = 300;
int bar = 350;
int cse = 400;
int aDb, bDb, csDb;
int stop = 0; //10-ig
int eredmeny = 0;
cin >> aDb >> bDb >> csDb;
for(int i = 0; i < 10; i++) {
if(stop == 10) {
break;
}
else {
if(aDb != 0) {
eredmeny += alm;
aDb--;
stop++;
}
else if(aDb == 0 && bDb != 0) {
eredmeny += bar;
bDb--;
stop++;
}
else if(aDb == 0 && bDb == 0 && csDb != 0) {
eredmeny += cse;
csDb--;
stop++;
}
}
}
if(stop < 10) {
cout << -1 << endl;
}
else {
cout << eredmeny << endl;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1888 KiB | ||||
2 | Accepted | 2ms | 2228 KiB | ||||
3 | Accepted | 2ms | 2292 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 2ms | 2520 KiB | ||||
5 | Accepted | 2ms | 2640 KiB | ||||
6 | Accepted | 2ms | 2640 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 2ms | 2640 KiB | ||||
8 | Accepted | 2ms | 2676 KiB | ||||
9 | Accepted | 2ms | 2904 KiB | ||||
10 | Accepted | 2ms | 2944 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 2ms | 3076 KiB | ||||
12 | Accepted | 2ms | 3148 KiB | ||||
13 | Accepted | 2ms | 3244 KiB | ||||
14 | Accepted | 2ms | 3252 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 2ms | 3244 KiB | ||||
16 | Accepted | 2ms | 3476 KiB | ||||
17 | Accepted | 2ms | 3608 KiB | ||||
18 | Accepted | 2ms | 3688 KiB | ||||
19 | Accepted | 2ms | 3816 KiB | ||||
20 | Accepted | 2ms | 3788 KiB |