68812023-12-19 13:33:17markvok15Bevásárláscpp17Wrong answer 30/1003ms3676 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
1Accepted3ms1872 KiB
2Accepted3ms2132 KiB
3Accepted3ms2332 KiB
subtask210/10
4Accepted3ms2496 KiB
5Accepted2ms2576 KiB
6Accepted3ms2696 KiB
subtask320/20
7Accepted3ms2832 KiB
8Accepted3ms2872 KiB
9Accepted3ms2868 KiB
10Accepted3ms2996 KiB
subtask40/30
11Wrong answer3ms3212 KiB
12Accepted3ms3360 KiB
13Accepted3ms3416 KiB
14Accepted3ms3504 KiB
subtask50/40
15Wrong answer3ms3456 KiB
16Accepted3ms3572 KiB
17Accepted3ms3676 KiB
18Accepted3ms3588 KiB
19Accepted3ms3588 KiB
20Accepted3ms3560 KiB