Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- string s;
- cin >> s;
- int klikovi = 0;
- for(int i = 0; i < s.size(); i++) {
- if(s[i] == 'Y') {
- for(int j = i; j < s.size(); j += i + 1) {
- if(s[j] == 'Y') {
- s[j] = 'N';
- }
- else {
- s[j] = 'Y';
- }
- }
- klikovi++;
- }
- }
- cout << klikovi << endl;
- return 0;
- }
- // NNNNNNNNaN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement