#include <bits/stdc++.h>
using namespace std;
bool czy_zepsuta[10];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
int grupa_testow = n/10;
string a; cin >> a;
int numer = 0;
for (int i = 1; i <= n; ++i){
numer = i/grupa_testow;
if (i % grupa_testow == 0){
numer--;
}
if (a[i - 1] == 'N'){
czy_zepsuta[numer] = true;
}
}
int ile_pkt = 10;
for (int i = 0; i <= 9; ++i){
if (czy_zepsuta[i] == true){
ile_pkt--;
}
}
cout << ile_pkt << "\n";
}
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 | #include <bits/stdc++.h> using namespace std; bool czy_zepsuta[10]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int grupa_testow = n/10; string a; cin >> a; int numer = 0; for (int i = 1; i <= n; ++i){ numer = i/grupa_testow; if (i % grupa_testow == 0){ numer--; } if (a[i - 1] == 'N'){ czy_zepsuta[numer] = true; } } int ile_pkt = 10; for (int i = 0; i <= 9; ++i){ if (czy_zepsuta[i] == true){ ile_pkt--; } } cout << ile_pkt << "\n"; } |
English