25312023-01-16 18:20:55szabosamuelMorze (60 pont)cpp11Wrong answer 30/603ms3952 KiB
#include <iostream>
using namespace std;

int main()
{
    string s;
    cin >> s;
    int maxi=0;
    while(s[maxi]=='.' || s[maxi]=='-') maxi++;
    int max1=maxi/5;
    string st[max1+1];
    string s2;
    for(int i=1; i<=max1; i++)
    {
        st[i].push_back(s[5*i-5]);
        st[i].push_back(s[5*i-4]);
        st[i].push_back(s[5*i-3]);
        st[i].push_back(s[5*i-2]);
        st[i].push_back(s[5*i-1]);
    }
    int n=0;
    for(int i=1; i<=max1; i++)
    {
        if(st[i]=="-----") n=10*n;
        else if(st[i]==".----" ) n=10*n+1;
        else if(st[i]=="..---" ) n=10*n+2;
        else if(st[i]=="...--" ) n=10*n+3;
        else if(st[i]=="....-" ) n=10*n+4;
        else if(st[i]=="....." ) n=10*n+5;
        else if(st[i]=="-...." ) n=10*n+6;
        else if(st[i]=="--..." ) n=10*n+7;
        else if(st[i]=="---.." ) n=10*n+8;
        else if(st[i]=="----." ) n=10*n+9;
    }
    cout << n;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/60
1Accepted0/03ms1680 KiB
2Wrong answer0/02ms1856 KiB
3Accepted3/32ms2048 KiB
4Accepted3/32ms2124 KiB
5Accepted3/32ms2376 KiB
6Accepted3/32ms2628 KiB
7Accepted3/32ms2824 KiB
8Accepted3/32ms3064 KiB
9Accepted4/42ms3092 KiB
10Accepted4/42ms3300 KiB
11Accepted4/42ms3456 KiB
12Wrong answer0/72ms3668 KiB
13Wrong answer0/72ms3740 KiB
14Wrong answer0/82ms3864 KiB
15Wrong answer0/82ms3952 KiB