68802023-12-19 13:32:12markvok15Bevásárláscpp17Wrong answer 0/1003ms3688 KiB
#include <iostream>

using namespace std;

int main()
{
    int A,B,C;
    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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1876 KiB
2Accepted3ms2392 KiB
3Wrong answer3ms2620 KiB
subtask20/10
4Accepted3ms2808 KiB
5Wrong answer3ms2888 KiB
6Wrong answer3ms3136 KiB
subtask30/20
7Wrong answer3ms2980 KiB
8Wrong answer3ms3160 KiB
9Wrong answer3ms3164 KiB
10Accepted3ms3176 KiB
subtask40/30
11Wrong answer3ms3272 KiB
12Wrong answer3ms3416 KiB
13Wrong answer3ms3420 KiB
14Wrong answer3ms3316 KiB
subtask50/40
15Wrong answer3ms3556 KiB
16Accepted3ms3660 KiB
17Accepted3ms3560 KiB
18Wrong answer3ms3536 KiB
19Wrong answer3ms3536 KiB
20Wrong answer3ms3688 KiB