1836 | 2022-12-04 18:54:45 | peter | Kvázi-Izogram | cpp17 | Wrong answer 30/100 | 72ms | 5372 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) * 101);
fgets(mondat[i], 101, 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')
{
db++;
}
}
if (db > 2)
{
isogram--;
}
}
}
printf("%d", isogram);
free(mondat);
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1364 KiB | ||||
2 | Accepted | 2ms | 1704 KiB | ||||
subtask2 | 30/30 | ||||||
3 | Accepted | 2ms | 1920 KiB | ||||
4 | Accepted | 2ms | 1860 KiB | ||||
5 | Accepted | 2ms | 2080 KiB | ||||
6 | Accepted | 2ms | 2328 KiB | ||||
7 | Accepted | 4ms | 4512 KiB | ||||
subtask3 | 0/50 | ||||||
8 | Wrong answer | 2ms | 2508 KiB | ||||
9 | Wrong answer | 2ms | 2360 KiB | ||||
10 | Wrong answer | 3ms | 2572 KiB | ||||
11 | Wrong answer | 3ms | 2624 KiB | ||||
12 | Wrong answer | 3ms | 2820 KiB | ||||
13 | Wrong answer | 3ms | 2964 KiB | ||||
subtask4 | 0/20 | ||||||
14 | Wrong answer | 6ms | 2964 KiB | ||||
15 | Wrong answer | 8ms | 2976 KiB | ||||
16 | Wrong answer | 16ms | 3224 KiB | ||||
17 | Wrong answer | 29ms | 3708 KiB | ||||
18 | Wrong answer | 52ms | 4440 KiB | ||||
19 | Wrong answer | 65ms | 5020 KiB | ||||
20 | Wrong answer | 72ms | 5372 KiB |