#include <bits/stdc++.h> using namespace std; int main() { int n, res = 0; string s; cin >> n >> s; int block = n / 10; for(int i = 0; i < n; i+=block) { if(s.substr(i, block).find('N') == string::npos) ++res; } cout << res << endl; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <bits/stdc++.h> using namespace std; int main() { int n, res = 0; string s; cin >> n >> s; int block = n / 10; for(int i = 0; i < n; i+=block) { if(s.substr(i, block).find('N') == string::npos) ++res; } cout << res << endl; } |