#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(0);
// cout.tie(0);
// freopen("input.in", "r", stdin);
ll n;
cin>>n;
bool l=0;
ll wyn=10;
string s;
cin>>s;
for(int i=1; i<=n; i++){
if(s[i-1]=='N'){
l=1;
}
if(i%(n/10)==0){
if(l==1){
wyn--;
// cout<<"ETF";
}
// cout<<"TNJN";
l=0;
}
}
cout<<wyn;
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 | #include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ios_base::sync_with_stdio(NULL); cin.tie(0); // cout.tie(0); // freopen("input.in", "r", stdin); ll n; cin>>n; bool l=0; ll wyn=10; string s; cin>>s; for(int i=1; i<=n; i++){ if(s[i-1]=='N'){ l=1; } if(i%(n/10)==0){ if(l==1){ wyn--; // cout<<"ETF"; } // cout<<"TNJN"; l=0; } } cout<<wyn; return 0; } |
English