110312024-06-26 16:42:26GervidMorze (60 pont)cpp17Accepted 60/603ms504 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/03ms356 KiB
2Accepted0/02ms504 KiB
3Accepted3/33ms356 KiB
4Accepted3/33ms400 KiB
5Accepted3/32ms356 KiB
6Accepted3/33ms356 KiB
7Accepted3/33ms356 KiB
8Accepted3/33ms356 KiB
9Accepted4/42ms356 KiB
10Accepted4/43ms356 KiB
11Accepted4/42ms356 KiB
12Accepted7/73ms504 KiB
13Accepted7/72ms400 KiB
14Accepted8/83ms360 KiB
15Accepted8/83ms400 KiB