1766 | 2022-12-02 20:47:38 | kdb | Bevásárlás | cpp11 | Accepted 100/100 | 3ms | 3944 KiB |
#include <iostream>
using namespace std;
int main()
{
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(false);
int a, b, c, w = 10;
cin >> a >> b >> c;
if (a > w) a = w;
if (b > w) b = w;
if (c > w) c = w;
if (a + b + c < 10) cout << -1 << endl;
else
{
int q = 0;
w -= a; q += 300 * a;
if (b > w) b = w;
w -= b; q += 350 * b;
if (c > w) c = w;
w -= c; q += 400 * c;
cout << q << endl;
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1928 KiB | ||||
2 | Accepted | 2ms | 2084 KiB | ||||
3 | Accepted | 2ms | 2160 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 2ms | 2388 KiB | ||||
5 | Accepted | 2ms | 2520 KiB | ||||
6 | Accepted | 2ms | 2592 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 2ms | 2792 KiB | ||||
8 | Accepted | 2ms | 3032 KiB | ||||
9 | Accepted | 2ms | 3104 KiB | ||||
10 | Accepted | 2ms | 3204 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 2ms | 3104 KiB | ||||
12 | Accepted | 2ms | 3232 KiB | ||||
13 | Accepted | 2ms | 3308 KiB | ||||
14 | Accepted | 2ms | 3312 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 2ms | 3408 KiB | ||||
16 | Accepted | 2ms | 3632 KiB | ||||
17 | Accepted | 2ms | 3536 KiB | ||||
18 | Accepted | 2ms | 3612 KiB | ||||
19 | Accepted | 2ms | 3708 KiB | ||||
20 | Accepted | 2ms | 3944 KiB |