17032022-12-01 16:14:37MetamorphosesKvázi-Izogramcpp11Accepted 100/10017ms4060 KiB
#include <iostream>
#include <algorithm>
#include <cctype>
#include <string>
using namespace std;

int main()
{
    cin.tie(0);
    int n;
    cin>>n;
    cin.get();
    //vector<string> mdatok;
    string aaa;
    int oc[26] = {0};
    int counter=0;

    for(int i = 0; i < n; i++){

        bool yes = true;
        getline(std::cin, aaa);
        std::string data = aaa;
       /* std::transform(data.begin(), data.end(), data.begin(),
                [](unsigned char c){ return std::tolower(c); });*/

       // cout << data << '\n';
        for(int j=0;j<data.size();j++){

            //cout << int(data[j]) << '\n';
            if(int(tolower(data[j])) >= 'a' && int(tolower(data[j])) <= 'z')
                oc[int(tolower(data[j]))-'a']++;

        }
        for(int j = ('a'-'a'); j <= ('z'-'a'); j++)
        {
           // cout << "j= "<< j << "kod= "<< oc[j] << "\n";
            if(oc[j] > 2){
                yes = false;
                break;
            }
        }
        for(int j = ('a'-'a'); j <= ('z'-'a'); j++)
        {
           // cout << "j= "<< j << "kod= "<< oc[j] << "\n";
           oc[j]=0;
        }
        if(yes)
            counter++;


        //cout << "Counter = " << counter << '\n';
    }
    cout << counter;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Accepted2ms2008 KiB
subtask230/30
3Accepted2ms2208 KiB
4Accepted2ms2416 KiB
5Accepted2ms2488 KiB
6Accepted2ms2616 KiB
7Accepted4ms2820 KiB
subtask350/50
8Accepted2ms2924 KiB
9Accepted2ms2992 KiB
10Accepted2ms3244 KiB
11Accepted2ms3328 KiB
12Accepted2ms3400 KiB
13Accepted2ms3404 KiB
subtask420/20
14Accepted3ms3532 KiB
15Accepted4ms3736 KiB
16Accepted4ms3856 KiB
17Accepted8ms3856 KiB
18Accepted12ms3852 KiB
19Accepted14ms3856 KiB
20Accepted17ms4060 KiB