1841 | 2022-12-04 18:59:32 | peter | Kvázi-Izogram | cpp17 | Wrong answer 30/100 | 72ms | 5992 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' || 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 | Accepted | 3ms | 1256 KiB | ||||
2 | Accepted | 2ms | 1760 KiB | ||||
subtask2 | 30/30 | ||||||
3 | Accepted | 2ms | 1700 KiB | ||||
4 | Accepted | 2ms | 1860 KiB | ||||
5 | Accepted | 2ms | 1952 KiB | ||||
6 | Accepted | 2ms | 2432 KiB | ||||
7 | Accepted | 4ms | 4716 KiB | ||||
subtask3 | 0/50 | ||||||
8 | Wrong answer | 2ms | 2804 KiB | ||||
9 | Wrong answer | 2ms | 2872 KiB | ||||
10 | Wrong answer | 2ms | 2988 KiB | ||||
11 | Wrong answer | 2ms | 3212 KiB | ||||
12 | Wrong answer | 3ms | 3220 KiB | ||||
13 | Wrong answer | 3ms | 3312 KiB | ||||
subtask4 | 0/20 | ||||||
14 | Wrong answer | 6ms | 3528 KiB | ||||
15 | Wrong answer | 8ms | 3672 KiB | ||||
16 | Wrong answer | 16ms | 3864 KiB | ||||
17 | Wrong answer | 29ms | 4348 KiB | ||||
18 | Wrong answer | 50ms | 5076 KiB | ||||
19 | Wrong answer | 64ms | 5572 KiB | ||||
20 | Wrong answer | 72ms | 5992 KiB |