1838 | 2022-12-04 18:57:07 | peter | Kvázi-Izogram | cpp17 | Wrong answer 30/100 | 71ms | 5948 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 | Wrong answer | 3ms | 1220 KiB | ||||
2 | Accepted | 2ms | 1492 KiB | ||||
subtask2 | 30/30 | ||||||
3 | Accepted | 2ms | 1704 KiB | ||||
4 | Accepted | 2ms | 1840 KiB | ||||
5 | Accepted | 2ms | 2168 KiB | ||||
6 | Accepted | 2ms | 2296 KiB | ||||
7 | Accepted | 4ms | 4396 KiB | ||||
subtask3 | 0/50 | ||||||
8 | Wrong answer | 2ms | 2324 KiB | ||||
9 | Wrong answer | 2ms | 2576 KiB | ||||
10 | Wrong answer | 3ms | 2580 KiB | ||||
11 | Wrong answer | 2ms | 2660 KiB | ||||
12 | Wrong answer | 3ms | 2796 KiB | ||||
13 | Wrong answer | 3ms | 3060 KiB | ||||
subtask4 | 0/20 | ||||||
14 | Wrong answer | 6ms | 3184 KiB | ||||
15 | Wrong answer | 8ms | 3408 KiB | ||||
16 | Wrong answer | 16ms | 3768 KiB | ||||
17 | Wrong answer | 29ms | 4156 KiB | ||||
18 | Wrong answer | 50ms | 5064 KiB | ||||
19 | Wrong answer | 65ms | 5692 KiB | ||||
20 | Wrong answer | 71ms | 5948 KiB |