16312022-11-30 17:18:50levente19Bevásárláscpp11Accepted 100/1003ms3816 KiB
#include <bits/stdc++.h>
#define speed ios::sync_with_stdio(0);cin.tie(0)
using namespace std;

int main()
{
    speed;
    int alm = 300;
    int bar = 350;
    int cse = 400;
    int aDb, bDb, csDb;
    int stop = 0; //10-ig
    int eredmeny = 0;

    cin >> aDb >> bDb >> csDb;

    for(int i = 0; i < 10; i++) {
        if(stop == 10) {
            break;
        }

        else {
            if(aDb != 0) {
                eredmeny += alm;
                aDb--;
                stop++;
            }

        else if(aDb == 0 && bDb != 0) {
                eredmeny += bar;
                bDb--;
                stop++;
            }

        else if(aDb == 0 && bDb == 0 && csDb != 0) {
                eredmeny += cse;
                csDb--;
                stop++;

            }
        }
    }

    if(stop < 10) {
        cout << -1 << endl;
    }

    else {
        cout << eredmeny << endl;
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1888 KiB
2Accepted2ms2228 KiB
3Accepted2ms2292 KiB
subtask210/10
4Accepted2ms2520 KiB
5Accepted2ms2640 KiB
6Accepted2ms2640 KiB
subtask320/20
7Accepted2ms2640 KiB
8Accepted2ms2676 KiB
9Accepted2ms2904 KiB
10Accepted2ms2944 KiB
subtask430/30
11Accepted2ms3076 KiB
12Accepted2ms3148 KiB
13Accepted2ms3244 KiB
14Accepted2ms3252 KiB
subtask540/40
15Accepted2ms3244 KiB
16Accepted2ms3476 KiB
17Accepted2ms3608 KiB
18Accepted2ms3688 KiB
19Accepted2ms3816 KiB
20Accepted2ms3788 KiB