11376 | 2024-08-29 12:14:43 | MCDave | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 632 KiB |
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n = 10, a, b, c, out = 0;
cin >> a >> b >> c;
out += min(a, n) * 300, n -= min(a, n);
out += min(b, n) * 350, n -= min(b, n);
out += min(c, n) * 400, n -= min(c, n);
if (n != 0)
{
cout << -1;
return 0;
}
cout << out;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 488 KiB | ||||
2 | Accepted | 3ms | 420 KiB | ||||
3 | Accepted | 3ms | 232 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 2ms | 488 KiB | ||||
5 | Accepted | 3ms | 488 KiB | ||||
6 | Accepted | 3ms | 488 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 3ms | 540 KiB | ||||
8 | Accepted | 2ms | 360 KiB | ||||
9 | Accepted | 3ms | 512 KiB | ||||
10 | Accepted | 2ms | 376 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 2ms | 632 KiB | ||||
12 | Accepted | 3ms | 504 KiB | ||||
13 | Accepted | 2ms | 492 KiB | ||||
14 | Accepted | 3ms | 424 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 3ms | 256 KiB | ||||
16 | Accepted | 3ms | 388 KiB | ||||
17 | Accepted | 3ms | 256 KiB | ||||
18 | Accepted | 3ms | 488 KiB | ||||
19 | Accepted | 2ms | 360 KiB | ||||
20 | Accepted | 2ms | 384 KiB |