#include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi pair<int,int> #define vi vector<int> #define vvi vector<vi> #define vll vector<ll> #define ST first #define ND second #define PB push_back void Solve() { int n; cin >> n; string s; cin >> s; int res=10; int l=n/10; for(int i=0; i<10; ++i) for(int j=0; j<l; ++j) if(s[l*i+j]=='N') { --res; break; } cout << res << "\n"; return; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); int t; //cin >> t; t=1; while(t--) { Solve(); } 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi pair<int,int> #define vi vector<int> #define vvi vector<vi> #define vll vector<ll> #define ST first #define ND second #define PB push_back void Solve() { int n; cin >> n; string s; cin >> s; int res=10; int l=n/10; for(int i=0; i<10; ++i) for(int j=0; j<l; ++j) if(s[l*i+j]=='N') { --res; break; } cout << res << "\n"; return; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); int t; //cin >> t; t=1; while(t--) { Solve(); } return 0; } |