227372026-01-15 17:35:02mihalykocsisMorze (60 pont)cpp17Accepted 60/602ms500 KiB
#include <bits/stdc++.h>

using namespace std;

int main () {
    string kod; cin >> kod;
    int hossz = kod.length() / 5;
    vector<int> szam (hossz);

    for (int i = 0; i < kod.length(); i += 5) {
        if (kod.substr(i, 5) == "-----") {
            szam[i / 5] = 0;
        } else if (kod.substr(i, 5) == ".----") {
            szam[i / 5] = 1;
        } else if (kod.substr(i, 5) == "..---") {
            szam[i / 5] = 2;
        } else if (kod.substr(i, 5) == "...--") {
            szam[i / 5] = 3;
        } else if (kod.substr(i, 5) == "....-") {
            szam[i / 5] = 4;
        } else if (kod.substr(i, 5) == ".....") {
            szam[i / 5] = 5;
        } else if (kod.substr(i, 5) == "-....") {
            szam[i / 5] = 6;
        } else if (kod.substr(i, 5) == "--...") {
            szam[i / 5] = 7;
        } else if (kod.substr(i, 5) == "---..") {
            szam[i / 5] = 8;
        } else if (kod.substr(i, 5) == "----.") {
            szam[i / 5] = 9;
        }
    }
    for (int i = 0; i < szam.size(); i++) {
        cout << szam[i];
    }
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/01ms332 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms316 KiB
8Accepted3/31ms316 KiB
9Accepted4/42ms316 KiB
10Accepted4/42ms316 KiB
11Accepted4/42ms316 KiB
12Accepted7/72ms500 KiB
13Accepted7/71ms316 KiB
14Accepted8/81ms316 KiB
15Accepted8/81ms316 KiB