57592023-09-18 18:15:34norbertvidaMorze (60 pont)cpp11Elfogadva 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");
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base60/60
1Elfogadva0/03ms1320 KiB
2Elfogadva0/02ms1648 KiB
3Elfogadva3/32ms1852 KiB
4Elfogadva3/32ms1972 KiB
5Elfogadva3/32ms1860 KiB
6Elfogadva3/32ms1928 KiB
7Elfogadva3/32ms1872 KiB
8Elfogadva3/33ms2100 KiB
9Elfogadva4/42ms2264 KiB
10Elfogadva4/42ms2600 KiB
11Elfogadva4/42ms2760 KiB
12Elfogadva7/72ms2936 KiB
13Elfogadva7/72ms3224 KiB
14Elfogadva8/82ms3296 KiB
15Elfogadva8/83ms3508 KiB