88002024-01-31 09:04:17CWMBevásárláscpp17Accepted 100/1003ms4008 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";
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1888 KiB
2Accepted3ms2120 KiB
3Accepted3ms2356 KiB
subtask210/10
4Accepted3ms2556 KiB
5Accepted3ms3060 KiB
6Accepted2ms2916 KiB
subtask320/20
7Accepted3ms3120 KiB
8Accepted2ms3132 KiB
9Accepted3ms3276 KiB
10Accepted2ms3260 KiB
subtask430/30
11Accepted3ms3664 KiB
12Accepted3ms3768 KiB
13Accepted3ms4008 KiB
14Accepted2ms3892 KiB
subtask540/40
15Accepted3ms3804 KiB
16Accepted3ms3892 KiB
17Accepted3ms3880 KiB
18Accepted3ms3888 KiB
19Accepted2ms3884 KiB
20Accepted2ms3988 KiB