69732023-12-23 08:28:33GervidMorze (60 pont)cpp17Accepted 60/603ms4104 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int i, j, k;
    string inp;
    cin >> inp;

    vector<string> morze = { "-----", ".----", "..---", "...--", "....-", ".....", "-....", "--...", "---..", "----." };

    for (i = 0; i < inp.size(); i+=5)
    {
        for (j = 0; j < 10; j++)
        {
            for (k = 0; k < 5; k++)
            {
                if (morze[j][k] != inp[i+k])
                {
                    break;
                }
            }

            if (k == 5)
            {
                cout << j;
                break;
            }
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/03ms2084 KiB
2Accepted0/03ms2240 KiB
3Accepted3/33ms2352 KiB
4Accepted3/33ms2872 KiB
5Accepted3/33ms2768 KiB
6Accepted3/33ms2748 KiB
7Accepted3/33ms2948 KiB
8Accepted3/33ms3160 KiB
9Accepted4/43ms3376 KiB
10Accepted4/43ms3460 KiB
11Accepted4/43ms3588 KiB
12Accepted7/73ms3668 KiB
13Accepted7/73ms3604 KiB
14Accepted8/83ms3852 KiB
15Accepted8/83ms4104 KiB