141242025-01-09 20:42:37sarminMorze (60 pont)cpp17Accepted 60/601ms512 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);

	string s; cin >> s;
	int n = (int) s.size(), shorts = 0, prev = 0;
	for (int i = 0; i < n; i++) {
        if (i - prev == 4) {
            if (s[i] == '.') shorts++;
            if (s[prev] == '-' && s[i] == '-') cout << 0;
            else if (s[prev] == '.') cout << shorts;
            else cout << 9 - shorts + 1;
            shorts = 0;
            prev = i + 1;
        } else {
            if (s[i] == '.') shorts++;
        }
	}

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/01ms316 KiB
2Accepted0/01ms512 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms320 KiB
8Accepted3/31ms316 KiB
9Accepted4/41ms508 KiB
10Accepted4/41ms316 KiB
11Accepted4/41ms512 KiB
12Accepted7/71ms316 KiB
13Accepted7/71ms316 KiB
14Accepted8/81ms316 KiB
15Accepted8/81ms420 KiB