2890 2023. 02. 02 09:06:39 CzDani Morze (60 pont) cpp14 Accepted 60/60 3ms 3680 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    string s, ans="";
    cin>>s;
    for (int i = 0; i < s.size()/5; i++) {
        string ss = s.substr(i*5, 5);
        char c = (ss=="-----"?'0':(ss==".----"?'1':(ss=="..---"?'2':(ss=="...--"?'3':(ss=="....-"?'4':(ss=="....."?'5':(ss=="-...."?'6':(ss=="--..."?'7':ss=="---.."?'8':'9'))))))));
        ans+=c;
    }
    cout<<ans;
}
Subtask Sum Test Verdict Time Memory
base 60/60
1 Accepted 0/0 3ms 1812 KiB
2 Accepted 0/0 3ms 2016 KiB
3 Accepted 3/3 2ms 2120 KiB
4 Accepted 3/3 2ms 2192 KiB
5 Accepted 3/3 2ms 2320 KiB
6 Accepted 3/3 3ms 2560 KiB
7 Accepted 3/3 3ms 2692 KiB
8 Accepted 3/3 3ms 2900 KiB
9 Accepted 4/4 3ms 3144 KiB
10 Accepted 4/4 2ms 3220 KiB
11 Accepted 4/4 2ms 3348 KiB
12 Accepted 7/7 3ms 3560 KiB
13 Accepted 7/7 2ms 3680 KiB
14 Accepted 8/8 3ms 3640 KiB
15 Accepted 8/8 3ms 3648 KiB