70472023-12-28 21:51:53IgnácMorze (60 pont)cpp17Accepted 60/603ms3380 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	string s, ans = "";
	cin >> s;
	for (int i = 0; i < s.size(); i += 5) {
		string sub = "";
		for (int j = i; j < i + 5; j++) {
			sub.push_back(s[j]);
		}

		if (sub == "-----") ans.push_back('0');
		if (sub == ".----") ans.push_back('1');
		if (sub == "..---") ans.push_back('2');
		if (sub == "...--") ans.push_back('3');
		if (sub == "....-") ans.push_back('4');
		if (sub == ".....") ans.push_back('5');
		if (sub == "-....") ans.push_back('6');
		if (sub == "--...") ans.push_back('7');
		if (sub == "---..") ans.push_back('8');
		if (sub == "----.") ans.push_back('9');
	}

	cout << ans;
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/03ms1808 KiB
2Accepted0/03ms2008 KiB
3Accepted3/33ms2212 KiB
4Accepted3/33ms2468 KiB
5Accepted3/33ms2660 KiB
6Accepted3/33ms2760 KiB
7Accepted3/33ms2876 KiB
8Accepted3/33ms2956 KiB
9Accepted4/43ms3168 KiB
10Accepted4/42ms3248 KiB
11Accepted4/43ms3216 KiB
12Accepted7/73ms3332 KiB
13Accepted7/73ms3220 KiB
14Accepted8/83ms3276 KiB
15Accepted8/83ms3380 KiB