2073 | 2022-12-16 16:39:51 | 4bs0lute0 | Kvázi-Izogram | cpp11 | Accepted 100/100 | 59ms | 6892 KiB |
#include <iostream>
#include <string>
using namespace std;
#define print(x) cout << x << endl;
int isogram(string* t, int size){
int c = 0;
for (int a = 0; a < size; a++){
int lc;
string s = t[a];
int len = s.length();
for (int i = 0; i < len; i++){
lc = 0;
if ((s[i] < 'a' || s[i] > 'z') && (s[i] > 'A' || s[i] < 'Z')){//
continue;
}
for (int j = 0; j < len; j++){
if (tolower(s[i]) == tolower(s[j])){
lc++;
}
if (lc > 2){
break;
}
}
if (lc > 2){ break;}
}
if (lc <= 2){ c++;}
}
return c;
}
int main()
{
int b;
cin >> b;
cin.get();
string a[b];
for (int i = 0; i < b; ++i){
getline(cin, a[i]);
}
print(isogram(a, b));
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 2ms | 2000 KiB | ||||
subtask2 | 30/30 | ||||||
3 | Accepted | 2ms | 2352 KiB | ||||
4 | Accepted | 2ms | 2568 KiB | ||||
5 | Accepted | 2ms | 2728 KiB | ||||
6 | Accepted | 2ms | 2864 KiB | ||||
7 | Accepted | 4ms | 3344 KiB | ||||
subtask3 | 50/50 | ||||||
8 | Accepted | 2ms | 2832 KiB | ||||
9 | Accepted | 2ms | 3040 KiB | ||||
10 | Accepted | 3ms | 3272 KiB | ||||
11 | Accepted | 3ms | 3356 KiB | ||||
12 | Accepted | 3ms | 3552 KiB | ||||
13 | Accepted | 3ms | 3560 KiB | ||||
subtask4 | 20/20 | ||||||
14 | Accepted | 4ms | 3720 KiB | ||||
15 | Accepted | 8ms | 3992 KiB | ||||
16 | Accepted | 14ms | 4456 KiB | ||||
17 | Accepted | 25ms | 5048 KiB | ||||
18 | Accepted | 43ms | 6020 KiB | ||||
19 | Accepted | 54ms | 6540 KiB | ||||
20 | Accepted | 59ms | 6892 KiB |