20732022-12-16 16:39:514bs0lute0Kvázi-Izogramcpp11Accepted 100/10059ms6892 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Accepted2ms2000 KiB
subtask230/30
3Accepted2ms2352 KiB
4Accepted2ms2568 KiB
5Accepted2ms2728 KiB
6Accepted2ms2864 KiB
7Accepted4ms3344 KiB
subtask350/50
8Accepted2ms2832 KiB
9Accepted2ms3040 KiB
10Accepted3ms3272 KiB
11Accepted3ms3356 KiB
12Accepted3ms3552 KiB
13Accepted3ms3560 KiB
subtask420/20
14Accepted4ms3720 KiB
15Accepted8ms3992 KiB
16Accepted14ms4456 KiB
17Accepted25ms5048 KiB
18Accepted43ms6020 KiB
19Accepted54ms6540 KiB
20Accepted59ms6892 KiB