20722022-12-16 12:57:26szabel26Morze (60 pont)cpp17Wrong answer 30/603ms3812 KiB
#include <iostream>
#include <string>
#include <vector>
#include <deque>
//#include <fstream>
using namespace std;

//ifstream cin("morze.in");
//ofstream cout("morze.out");

char a;

deque<char>s;
vector<char>f;

int i=0,M;

int main()
{
    //s[0]=a;
    while(cin>>a)
        s.push_back(a);

    while(!s.empty())
    {
        //f.resize(i);
        f.push_back(s[0]);
        s.pop_front();
        if(f.size()==5)
        {
            if(f[0]=='-' && f[0]==f[4]) M=M*10+0;
                else if (f[0]=='.' && f[1]!=f[0]) M=M*10+1;
                    else if (f[1]=='.' && f[1]!=f[2]) M=M*10+2;
                        else if (f[2]=='.' && f[2]!=f[3]) M=M*10+3;
                            else if (f[3]=='.' && f[3]!=f[4]) M=M*10+4;
                                else if (f[4]=='.' && f[4]==f[0]) M=M*10+5;
                                    else if (f[0]=='-' && f[0]!=f[1]) M=M*10+6;
                                        else if (f[1]=='-' && f[1]!=f[2]) M=M*10+7;
                                            else if (f[2]=='-' && f[2]!=f[3]) M=M*10+8;
                                                else if (f[3]=='-' && f[3]!=f[4]) M=M*10+9;
            f.erase(f.begin(),f.end());
            //i=0;
            f.resize(0);
        }
        ++i;
    }
    cout<<M;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base30/60
1Accepted0/03ms1816 KiB
2Wrong answer0/02ms2052 KiB
3Accepted3/32ms2208 KiB
4Accepted3/32ms2352 KiB
5Accepted3/32ms2516 KiB
6Accepted3/32ms2716 KiB
7Accepted3/32ms2956 KiB
8Accepted3/32ms3124 KiB
9Accepted4/42ms3196 KiB
10Accepted4/42ms3324 KiB
11Accepted4/42ms3404 KiB
12Wrong answer0/72ms3528 KiB
13Wrong answer0/72ms3732 KiB
14Wrong answer0/82ms3812 KiB
15Wrong answer0/82ms3812 KiB