#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int n,res=0;
string s;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>n;
int d=n/10;
cin>>s;
n=s.size();
for(int i=0;i<n;i+=d){
bool ok=0;
for(int j=i;j<i+d;++j)
if(s[j]=='N')
ok=1;
if(!ok)
++res;
}
cout<<res;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include<bits/stdc++.h> using namespace std; using ll=long long; int n,res=0; string s; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin>>n; int d=n/10; cin>>s; n=s.size(); for(int i=0;i<n;i+=d){ bool ok=0; for(int j=i;j<i+d;++j) if(s[j]=='N') ok=1; if(!ok) ++res; } cout<<res; } |
English