Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std ;
- #define sz(s) int(s.size())
- #define all(v) v.begin() , v.end()
- #define imin INT_MIN
- #define imax INT_MAX
- typedef long long ll ;
- #define Time cerr << "Time Taken: " << (float)clock() / CLOCKS_PER_SEC << " Secs" << "\n";
- #define all(s) s.begin(), s.end()
- #define cin(v) for (auto& i : v) cin >> i ;
- #define pb(x) push_back(x)
- #define getline(s) getline(cin >> ws, s)
- void ABDEL3AL () {
- ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
- #ifndef ONLINE_JUDGE
- freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
- #endif
- Time
- }
- int main() {
- ABDEL3AL() ;
- int n ; cin >> n ;
- string s , ans ;
- cin >> s ;
- vector < string > v ;
- for (int i = 0; i < sz(s); i++) {
- if (s[i] == 'x') ans += 'x' ;
- else {
- v.pb(ans) ;
- ans = "" ;
- }
- }
- int sum = 0 ;
- for (int i = 0; i < sz(v); i++) {
- while (sz(ans) != 2) ans.pop_back() , sum += 1 ;
- }
- cout << sum << "\n" ;
- return 0;
- }
Add Comment
Please, Sign In to add comment