38232023-03-03 10:10:31DalmaMorze (60 pont)cpp17Accepted 60/603ms3560 KiB
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string egesz;
    cin >> egesz;
    int hosszusag=egesz.length();
    char morze[hosszusag];
    int eredmeny[hosszusag/5]={0};
    for (int i=0; i<hosszusag; i++)
    {
        morze[i]=egesz[i];
    }
    for (int i=1; i<=hosszusag/5; i++)
    {
        if (morze[i*5-5]=='.')
        {
            if (morze[i*5-4]=='.')
            {
                if (morze[i*5-3]=='.')
                {
                    if (morze[i*5-2]=='.')
                    {
                        if (morze[i*5-1]=='.')
                        {
                            eredmeny[i-1]=5;
                        }
                        if (morze[i*5-1]=='-')
                        {
                            eredmeny[i-1]=4;
                        }
                    }
                    if (morze[i*5-2]=='-')
                    {
                        if (morze[i*5-1]=='-')
                        {
                            eredmeny[i-1]=3;
                        }
                    }
                }
                if (morze[i*5-3]=='-')
                {
                    eredmeny[i-1]=2;
                }
            }
            if (morze[i*5-4]=='-')
            {
                eredmeny[i-1]=1;
            }
        }
        if (morze[i*5-5]=='-')
        {
            if (morze[i*5-4]=='.')
            {
                eredmeny[i-1]=6;
            }
            if (morze[i*5-4]=='-')
            {
                if (morze[i*5-3]=='.')
                {
                    eredmeny[i-1]=7;
                }
                if (morze[i*5-3]=='-')
                {
                    if (morze[i*5-2]=='.')
                    {
                        eredmeny[i-1]=8;
                    }
                    if (morze[i*5-2]=='-')
                    {
                        if (morze[i*5-1]=='.')
                        {
                            eredmeny[i-1]=9;
                        }
                        if (morze[i*5-1]=='-')
                        {
                            eredmeny[i-1]==0;
                        }
                    }
                }
            }
        }
    }
    for (int i=0; i<hosszusag/5; i++)
    {
        cout << eredmeny[i];
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/03ms1812 KiB
2Accepted0/03ms2176 KiB
3Accepted3/32ms2168 KiB
4Accepted3/33ms2408 KiB
5Accepted3/32ms2468 KiB
6Accepted3/32ms2484 KiB
7Accepted3/32ms2608 KiB
8Accepted3/33ms2620 KiB
9Accepted4/42ms2860 KiB
10Accepted4/42ms3200 KiB
11Accepted4/43ms3320 KiB
12Accepted7/72ms3372 KiB
13Accepted7/72ms3500 KiB
14Accepted8/82ms3544 KiB
15Accepted8/82ms3560 KiB