6199 | 2023-11-07 10:07:16 | Ghost | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 4008 KiB |
#include <iostream>
#include <vector>
using namespace std;
int main()
{
const int almaFT = 300;
const int barackFT = 350;
const int cseresznyeFT = 400;
int alma, barack, cseresznye;
cin >> alma >> barack >> cseresznye;
if (alma + barack + cseresznye < 10) {
cout << -1;
}
else {
int out = 0;
for (int i = 0; i < 10; i++) {
if (alma > 0) {
out += almaFT;
alma--;
}
else if (barack > 0) {
out += barackFT;
barack--;
}
else if (cseresznye > 0) {
out += cseresznyeFT;
cseresznye--;
}
}
cout << out;
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1748 KiB | ||||
2 | Accepted | 3ms | 1908 KiB | ||||
3 | Accepted | 3ms | 2156 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 2ms | 2240 KiB | ||||
5 | Accepted | 3ms | 2492 KiB | ||||
6 | Accepted | 2ms | 2540 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 3ms | 2664 KiB | ||||
8 | Accepted | 3ms | 2800 KiB | ||||
9 | Accepted | 3ms | 3008 KiB | ||||
10 | Accepted | 3ms | 3368 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 3ms | 3272 KiB | ||||
12 | Accepted | 3ms | 3484 KiB | ||||
13 | Accepted | 3ms | 3716 KiB | ||||
14 | Accepted | 2ms | 3760 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 2ms | 3888 KiB | ||||
16 | Accepted | 2ms | 3992 KiB | ||||
17 | Accepted | 2ms | 3992 KiB | ||||
18 | Accepted | 2ms | 4008 KiB | ||||
19 | Accepted | 2ms | 3760 KiB | ||||
20 | Accepted | 3ms | 3888 KiB |