#include <iostream>
#include <algorithm>
using namespace std;
long long n, m, x, a, b, c, d ,g, t, w;
string j;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
cin >> n;
cin >> j;
t=n/10;
for(int i=0; i<10; i++){
x=1;
for (int k=0; k<t; k++){
if(j[k+i*t]=='N'){
x=0;
}
}
if(x==1){
w++;
}
}
cout << w;
}
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 | #include <iostream> #include <algorithm> using namespace std; long long n, m, x, a, b, c, d ,g, t, w; string j; int main(){ cin.tie(0); ios_base::sync_with_stdio(0); cin >> n; cin >> j; t=n/10; for(int i=0; i<10; i++){ x=1; for (int k=0; k<t; k++){ if(j[k+i*t]=='N'){ x=0; } } if(x==1){ w++; } } cout << w; } |
English