#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string s; cin >> s; int ans = 0; vector<int> bad(10, 0); for(int i=0;i<n;i++){ bad[i / (n / 10)] += (s[i] == 'N'); } for(int x : bad) ans += (x == 0); cout << ans << "\n"; return 0; } /* g++ -std=c++17 -Wall -Wshadow -Wextra -O2 -fsanitize=address -fsanitize=undefined c.cpp -o c */
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string s; cin >> s; int ans = 0; vector<int> bad(10, 0); for(int i=0;i<n;i++){ bad[i / (n / 10)] += (s[i] == 'N'); } for(int x : bad) ans += (x == 0); cout << ans << "\n"; return 0; } /* g++ -std=c++17 -Wall -Wshadow -Wextra -O2 -fsanitize=address -fsanitize=undefined c.cpp -o c */ |