#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 1e6 + 17;
int dzwieki[MAXN];
int main()
{
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
int n;
string s;
cin >> n >> s;
int g = n/10;
int odp = 0;
for(int j = 0; j < 10; ++j)
{
bool dobrze = 1;
for(int i = 0; i < g; ++i)
{
if(s[g*j+i] == 'N')
dobrze = 0;
}
if(dobrze)
++odp;
}
cout << odp;
}
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 | #include <bits/stdc++.h> using namespace std; constexpr int MAXN = 1e6 + 17; int dzwieki[MAXN]; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int n; string s; cin >> n >> s; int g = n/10; int odp = 0; for(int j = 0; j < 10; ++j) { bool dobrze = 1; for(int i = 0; i < g; ++i) { if(s[g*j+i] == 'N') dobrze = 0; } if(dobrze) ++odp; } cout << odp; } |
English