18432022-12-05 07:44:47peterKvázi-Izogramcpp17Accepted 100/10045ms5928 KiB
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int main()
{
    int mondatokszama;
    scanf("%d\n", &mondatokszama);
    char** mondat = (char**)malloc(sizeof(char*) * mondatokszama);
    for (int i = 0; i < mondatokszama; i++)
    {
        mondat[i] = (char*)malloc(sizeof(char) * 103);
        fgets(mondat[i], 103, stdin);
    }

    int isogram = mondatokszama;
    for (int i = 0; i < mondatokszama; i++)
    {
        for (int j = 0; j < strlen(mondat[i]) - 1; j++)
        {
            int db = 1;
            for (int k = j + 1; k < strlen(mondat[i]); k++)
            {
                
                if (tolower(mondat[i][j]) == tolower(mondat[i][k]) && (mondat[i][j] >= 'A' && mondat[i][j] <= 'Z' || mondat[i][j] >= 'a' && mondat[i][j] <= 'z'))
                {
                    db++;
                }
            }
            if (db > 2)
            {
                isogram--;
                break;
            }
        }
    }

    printf("%d", isogram);

    for (int i = 0; i < mondatokszama; i++)
    {
        free(mondat[i]);
    }
    free(mondat);

    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1364 KiB
2Accepted2ms1444 KiB
subtask230/30
3Accepted2ms1760 KiB
4Accepted2ms1960 KiB
5Accepted2ms2116 KiB
6Accepted2ms2456 KiB
7Accepted4ms4688 KiB
subtask350/50
8Accepted2ms2652 KiB
9Accepted2ms2744 KiB
10Accepted2ms2884 KiB
11Accepted2ms2936 KiB
12Accepted2ms3012 KiB
13Accepted2ms2956 KiB
subtask420/20
14Accepted4ms3280 KiB
15Accepted6ms3176 KiB
16Accepted9ms3416 KiB
17Accepted18ms4080 KiB
18Accepted32ms4884 KiB
19Accepted41ms5564 KiB
20Accepted45ms5928 KiB