#include <algorithm>
#include <limits>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
int n;
string s;
cin>>n>>s;
int wyn=0, rg=n/10;
for (int g=0; g<10; ++g)
{
bool ok=true;
for (int t=0; t<rg; ++t)
if (s[g*rg+t]!='T')
ok=false;
if (ok)
++wyn;
}
cout<<wyn<<endl;
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include <algorithm> #include <limits> #include <map> #include <set> #include <sstream> #include <string> #include <vector> #include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); int n; string s; cin>>n>>s; int wyn=0, rg=n/10; for (int g=0; g<10; ++g) { bool ok=true; for (int t=0; t<rg; ++t) if (s[g*rg+t]!='T') ok=false; if (ok) ++wyn; } cout<<wyn<<endl; return 0; } |
English