132362025-01-07 10:13:56MezeiDavidMorze (60 pont)cpp17Accepted 60/601ms508 KiB
#include <iostream>
#include <bits/stdc++.h>
#include <map>

using namespace std;

int main()
{
    string n;
    map<string, int> g;
    g["-----"] = 0;
    g[".----"] = 1;
    g["..---"] = 2;
    g["...--"] = 3;
    g["....-"] = 4;
    g["....."] = 5;
    g["-...."] = 6;
    g["--..."] = 7;
    g["---.."] = 8;
    g["----."] = 9;
    cin >> n;
    //cout << n << "\n";
    for(int i = 0; i < n.size() / 5; i++)
    {
        string c = "00000";
        //cout << c.size() << "\n";
        for(int j = 0; j < 5; j++)
        {
            c[j] = n[5*i + j];
        }
        //cout << c << "\n";
        cout << g[c];
    }
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/01ms316 KiB
2Accepted0/01ms328 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms316 KiB
9Accepted4/41ms508 KiB
10Accepted4/41ms316 KiB
11Accepted4/41ms316 KiB
12Accepted7/71ms316 KiB
13Accepted7/71ms316 KiB
14Accepted8/81ms316 KiB
15Accepted8/81ms316 KiB