61992023-11-07 10:07:16GhostBevásárláscpp17Accepted 100/1003ms4008 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;
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1748 KiB
2Accepted3ms1908 KiB
3Accepted3ms2156 KiB
subtask210/10
4Accepted2ms2240 KiB
5Accepted3ms2492 KiB
6Accepted2ms2540 KiB
subtask320/20
7Accepted3ms2664 KiB
8Accepted3ms2800 KiB
9Accepted3ms3008 KiB
10Accepted3ms3368 KiB
subtask430/30
11Accepted3ms3272 KiB
12Accepted3ms3484 KiB
13Accepted3ms3716 KiB
14Accepted2ms3760 KiB
subtask540/40
15Accepted2ms3888 KiB
16Accepted2ms3992 KiB
17Accepted2ms3992 KiB
18Accepted2ms4008 KiB
19Accepted2ms3760 KiB
20Accepted3ms3888 KiB