69592023-12-21 22:58:43999Morze (60 pont)cpp17Runtime error 30/604ms3776 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	string v;cin>>v;
	int n=v.size();
	string num;
	int i=n-1;
	while(i>=4){
		string ss=v.substr(i-4,5);
		i-=5;
		if(ss=="-----")num+='0';
		if(ss==".----")num+='1';
		if(ss=="..---")num+='2';
		if(ss=="...--")num+='3';
		if(ss=="....-")num+='4';
		if(ss==".....")num+='5';
		if(ss=="-....")num+='6';
		if(ss=="--...")num+='7';
		if(ss=="---..")num+='8';
		if(ss=="----.")num+='9';
	}
	reverse(num.begin(),num.end());
	cout<<stoi(num)<<endl;
}
SubtaskSumTestVerdictTimeMemory
base30/60
1Accepted0/03ms1808 KiB
2Runtime error0/04ms2604 KiB
3Accepted3/33ms2304 KiB
4Accepted3/33ms2416 KiB
5Accepted3/33ms2448 KiB
6Accepted3/33ms2636 KiB
7Accepted3/33ms2724 KiB
8Accepted3/33ms2852 KiB
9Accepted4/43ms2996 KiB
10Accepted4/43ms2972 KiB
11Accepted4/43ms3036 KiB
12Runtime error0/74ms3448 KiB
13Runtime error0/74ms3776 KiB
14Runtime error0/84ms3660 KiB
15Runtime error0/84ms3736 KiB