57592023-09-18 18:15:34norbertvidaMorze (60 pont)cpp11Accepted 60/603ms3508 KiB
#include <stdio.h>
#include <string.h>
#define calc(a, b, c, d, e) ((a - 45) << 4 | (b - 45) << 3 | (c - 45) << 2 | (d - 45) << 1 | (e - 45))
int main() {
    int nums[32];
    nums[calc('-','-','-','-','-')] = 0;
    nums[calc('.','-','-','-','-')] = 1;
    nums[calc('.','.','-','-','-')] = 2;
    nums[calc('.','.','.','-','-')] = 3;
    nums[calc('.','.','.','.','-')] = 4;
    nums[calc('.','.','.','.','.')] = 5;
    nums[calc('-','.','.','.','.')] = 6;
    nums[calc('-','-','.','.','.')] = 7;
    nums[calc('-','-','-','.','.')] = 8;
    nums[calc('-','-','-','-','.')] = 9;
    char in[1001];
    scanf("%s", in);
    int inl = strlen(in);
    for(int i = 0, t; i < inl; i += 5) {
        printf("%d", nums[calc(in[i], in[i + 1], in[i + 2], in[i + 3], in[i + 4])]);
    }
    printf("\n");
}
SubtaskSumTestVerdictTimeMemory
base60/60
1Accepted0/03ms1320 KiB
2Accepted0/02ms1648 KiB
3Accepted3/32ms1852 KiB
4Accepted3/32ms1972 KiB
5Accepted3/32ms1860 KiB
6Accepted3/32ms1928 KiB
7Accepted3/32ms1872 KiB
8Accepted3/33ms2100 KiB
9Accepted4/42ms2264 KiB
10Accepted4/42ms2600 KiB
11Accepted4/42ms2760 KiB
12Accepted7/72ms2936 KiB
13Accepted7/72ms3224 KiB
14Accepted8/82ms3296 KiB
15Accepted8/83ms3508 KiB