1703 | 2022-12-01 16:14:37 | Metamorphoses | Kvázi-Izogram | cpp11 | Accepted 100/100 | 17ms | 4060 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1808 KiB | ||||
2 | Accepted | 2ms | 2008 KiB | ||||
subtask2 | 30/30 | ||||||
3 | Accepted | 2ms | 2208 KiB | ||||
4 | Accepted | 2ms | 2416 KiB | ||||
5 | Accepted | 2ms | 2488 KiB | ||||
6 | Accepted | 2ms | 2616 KiB | ||||
7 | Accepted | 4ms | 2820 KiB | ||||
subtask3 | 50/50 | ||||||
8 | Accepted | 2ms | 2924 KiB | ||||
9 | Accepted | 2ms | 2992 KiB | ||||
10 | Accepted | 2ms | 3244 KiB | ||||
11 | Accepted | 2ms | 3328 KiB | ||||
12 | Accepted | 2ms | 3400 KiB | ||||
13 | Accepted | 2ms | 3404 KiB | ||||
subtask4 | 20/20 | ||||||
14 | Accepted | 3ms | 3532 KiB | ||||
15 | Accepted | 4ms | 3736 KiB | ||||
16 | Accepted | 4ms | 3856 KiB | ||||
17 | Accepted | 8ms | 3856 KiB | ||||
18 | Accepted | 12ms | 3852 KiB | ||||
19 | Accepted | 14ms | 3856 KiB | ||||
20 | Accepted | 17ms | 4060 KiB |