68412023-12-19 10:54:52HunMartin23Bevásárláscpp17Hibás válasz 30/1003ms4060 KiB
#include <iostream>

using namespace std;

int main()
{
    int A,B,C,o=0;
    cin>>A>>B>>C;
    if(A+B+C<10)
    {
        cout<<-1;
    }
    else if (A>=10)
    {
        cout<<10*300;
    }
    else if(A+B>=10)
    {
        switch (A)
        {
        case 1: cout<<1*300+9*350;
            break;
        case 2: cout<<2*300+8*350;
            break;
        case 3: cout<<3*300+7*350;
            break;
        case 4: cout<<4*300+6*350;
            break;
        case 5: cout<<5*300+5*350;
            break;
        case 6: cout<<6*300+4*350;
            break;
        case 7: cout<<7*300+3*350;
            break;
        case 8: cout<<8*300+2*350;
            break;
        case 9: cout<<9*300+1*350;
            break;
        case 0: cout<<0*300+10*350;
            break;
        }
    }
    else if(A+B+C>=10)
    {
        switch(A)
        {
        case 1: switch(B)
            {
            case 0:cout<<300*1+0*350+9*400;
                break;
            case 1:cout<<300*1+1*350+8*400 ;
                break;
            case 2:cout<<300*1+2*350+7*400 ;
                break;
            case 3:cout<<300*1+3*350+6*400 ;
                break;
            case 4:cout<<300*1+4*350+5*400 ;
                break;
            case 5:cout<<300*1+5*350+4*400 ;
                break;
            case 6:cout<<300*1+6*350+3*400 ;
                break;
            case 7:cout<<300*1+7*350+2*400 ;
                break;
            case 8:cout<<300*1+8*350+1*400 ;
                break;
            case 9:cout<<300*1+9*350+0*400 ;
                break;
            };
            break;
        case 2: switch(B)
                {
                case 0:cout<<300*2+0*350+8*400;
                    break;
                case 1:cout<<300*2+1*350+7*400 ;
                    break;
                case 2:cout<<300*2+2*350+6*400 ;
                    break;
                case 3:cout<<300*2+3*350+5*400 ;
                    break;
                case 4:cout<<300*2+4*350+4*400 ;
                    break;
                case 5:cout<<300*2+5*350+3*400 ;
                    break;
                case 6:cout<<300*2+6*350+2*400 ;
                    break;
                case 7:cout<<300*2+7*350+1*400 ;
                    break;
                 case 8:cout<<300*2+8*350+0*400 ;
                    break;
            };
            break;
        case 3: switch(B)
                {
                case 0:cout<<300*3+0*350+7*400;
                    break;
                case 1:cout<<300*3+1*350+6*400 ;
                    break;
                case 2:cout<<300*3+2*350+5*400 ;
                    break;
                case 3:cout<<300*3+3*350+4*400 ;
                    break;
                case 4:cout<<300*3+4*350+3*400 ;
                    break;
                case 5:cout<<300*3+5*350+2*400 ;
                    break;
                case 6:cout<<300*3+6*350+1*400 ;
                    break;
                    case 7:cout<<300*3+7*350+0*400 ;
                    break;}
            break; ;
        case 4:switch(B)
                {
                case 0:cout<<300*4+0*350+6*400;
                    break;
                case 1:cout<<300*4+1*350+5*400 ;
                    break;
                case 2:cout<<300*4+2*350+4*400 ;
                    break;
                case 3:cout<<300*4+3*350+3*400 ;
                    break;
                case 4:cout<<300*4+4*350+2*400 ;
                    break;
                case 5:cout<<300*4+5*350+1*400 ;
                    break;
                case 6:cout<<300*4+6*350+0*400 ;
                    break;}
            break;
        case 5:switch(B)
                {
                case 0:cout<<300*5+0*350+5*400;
                    break;
                case 1:cout<<300*5+1*350+4*400 ;
                    break;
                case 2:cout<<300*5+2*350+3*400 ;
                    break;
                case 3:cout<<300*5+3*350+2*400 ;
                    break;
                case 4:cout<<300*5+4*350+1*400 ;
                    break;
                    case 5:cout<<300*5+5*350+0*400 ;
                    break;}
            break;
        case 6:switch(B)
                {
                case 0:cout<<300*6+0*350+4*400;
                    break;
                case 1:cout<<300*6+1*350+3*400 ;
                    break;
                case 2:cout<<300*6+2*350+2*400 ;
                    break;
                case 3:cout<<300*6+3*350+1*400 ;
                    break;
                case 4:cout<<300*6+4*350+0*400 ;
                    break; }
            break;
        case 7:switch(B)
                {
                case 0:cout<<300*7+0*350+3*400;
                    break;
                case 1:cout<<300*7+1*350+2*400 ;
                    break;
                case 2:cout<<300*7+2*350+1*400 ;
                    break;
                case 3:cout<<300*7+3*350+0*400 ;
                    break; }
            break;
        case 8: switch(B)
                {
                case 0:cout<<300*8+0*350+2*400;
                    break;
                case 1:cout<<300*8+1*350+1*400 ;
                    break;
                case 2:cout<<300*8+2*350+0*400 ;
                    break;}
          break;
        case 9:{
            switch (B)
            {
                case 0:cout<<300*9+0*350+1*400;
                    break;
                case 1: cout<<300*10+0*350+0*400;
                    break;
            }
        }
        }
    }
    else if(B+C>=10)
    {
        switch(B)
        {case 1:cout<<1*350+9*400;
        break;
        case 2: cout<<2*350+8*400 ;
        break;
        case 3: cout<<3*350+7*400 ;
        break;
        case 4: cout<<4*350+6*400 ;
        break;
        case 5: cout<<5*350+5*400 ;
        break;
        case 6: cout<<6*350+4*400 ;
        break;
        case 7: cout<<7*350+3*400 ;
        break;
        case 8: cout<<8*350+2*400 ;
        break;
        case 9: cout<<9*350+1*400 ;
        break;
        case 0: cout<<10*350+0*400;
        break;}
    }
    else if(C>=10)
    {
        cout<<10*400;
    }

    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
subtask10/0
1Elfogadva3ms1872 KiB
2Elfogadva3ms2124 KiB
3Elfogadva3ms2368 KiB
subtask210/10
4Elfogadva3ms2524 KiB
5Elfogadva3ms2912 KiB
6Elfogadva3ms3056 KiB
subtask320/20
7Elfogadva3ms3272 KiB
8Elfogadva3ms3328 KiB
9Elfogadva3ms3492 KiB
10Elfogadva3ms3724 KiB
subtask40/30
11Hibás válasz3ms3504 KiB
12Elfogadva3ms3576 KiB
13Elfogadva3ms3808 KiB
14Elfogadva3ms3896 KiB
subtask50/40
15Hibás válasz3ms3856 KiB
16Elfogadva3ms3968 KiB
17Elfogadva3ms3968 KiB
18Elfogadva3ms3848 KiB
19Elfogadva3ms3972 KiB
20Elfogadva3ms4060 KiB