Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <queue>
  5. #include <stack>
  6. #include <map>
  7. #include <algorithm>
  8. #include <numeric>
  9. #include <functional>
  10. #include <set>
  11. #include <sstream>
  12. #include <cstdio>
  13. #include <cstdlib>
  14. #include <cstring>
  15. #include <cmath>
  16. #include <cctype>
  17. #include <climits>
  18. #include <fstream>
  19. #include <time.h>
  20.  
  21. #define ll long long
  22. #define FOR(i,a,b) for(int i=(a);i<(b);++i)
  23. #define REP(i,n) FOR(i,0,n)
  24. #define FOE(i,a) for(auto i : a)
  25. #define ALL(c) (c).begin(), (c).end()
  26. #define DUMP(x) cerr << #x << " = " << (x) << endl;
  27. #define SUM(x) std::accumulate(ALL(x), 0L)
  28. #define EPS 1e-14
  29.  
  30. using namespace std;
  31.  
  32. struct ErasingCharacters {
  33. string s;
  34. string simulate(string _s) {
  35. s = _s;
  36.  
  37. FOR(i, 1, s.size()) {
  38. if (s[i - 1] == s[i]) {
  39. return simulate(s.erase(i - 1, 2));
  40. }
  41. }
  42.  
  43. return s;
  44. }
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement