8800 | 2024-01-31 09:04:17 | CWM | Bevásárlás | cpp17 | Accepted 100/100 | 3ms | 4008 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <queue>
#include <set>
#include <map>
using namespace std;
using ll = long long;
signed main()
{
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int prices[] = { 300, 350, 400 };
int c = 10;
int sum = 0;
for (int i = 0; i < 3; i++)
{
int next;
cin >> next;
sum += min(c, next) * prices[i];
c -= min(c, next);
}
cout << (c == 0 ? sum : -1) << "\n";
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1888 KiB | ||||
2 | Accepted | 3ms | 2120 KiB | ||||
3 | Accepted | 3ms | 2356 KiB | ||||
subtask2 | 10/10 | ||||||
4 | Accepted | 3ms | 2556 KiB | ||||
5 | Accepted | 3ms | 3060 KiB | ||||
6 | Accepted | 2ms | 2916 KiB | ||||
subtask3 | 20/20 | ||||||
7 | Accepted | 3ms | 3120 KiB | ||||
8 | Accepted | 2ms | 3132 KiB | ||||
9 | Accepted | 3ms | 3276 KiB | ||||
10 | Accepted | 2ms | 3260 KiB | ||||
subtask4 | 30/30 | ||||||
11 | Accepted | 3ms | 3664 KiB | ||||
12 | Accepted | 3ms | 3768 KiB | ||||
13 | Accepted | 3ms | 4008 KiB | ||||
14 | Accepted | 2ms | 3892 KiB | ||||
subtask5 | 40/40 | ||||||
15 | Accepted | 3ms | 3804 KiB | ||||
16 | Accepted | 3ms | 3892 KiB | ||||
17 | Accepted | 3ms | 3880 KiB | ||||
18 | Accepted | 3ms | 3888 KiB | ||||
19 | Accepted | 2ms | 3884 KiB | ||||
20 | Accepted | 2ms | 3988 KiB |