Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.28 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2.  
  3. #include <iostream>
  4. #include <string>
  5. #include <vector>
  6. #include <map>
  7. #include <queue>
  8. #include <algorithm>
  9. #include <cmath>
  10. #include <set>
  11. #include <cstdio>
  12. #include <bitset>
  13. #include <list>
  14. #include <iterator>
  15. #include <time.h>
  16. #include <deque>
  17.  
  18. #pragma GCC optimize("Ofast")
  19. //#pragma GCC optimize("no-stack-protector")
  20. #pragma GCC optimize("unroll-loops")
  21. //#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
  22. //#pragma GCC optimize("fast-math")
  23.  
  24. using namespace std;
  25.  
  26. typedef long long ll;
  27. typedef long double ld;
  28.  
  29. #define int long long
  30.  
  31. const int inf = 1e9 + 7;
  32. const ll INF = 4 * (ll)1e18 + 7;
  33. const ld eps = 1e-9;
  34. const ll mod = 1e9 + 7;
  35.  
  36. int f(int x)
  37. {
  38.     return 3 * (x * x - 16) * (x * x - 16) + 5;
  39. }
  40. signed main()
  41. {
  42.  
  43. #ifdef LOCAL
  44.     freopen("output.txt", "w", stdout);
  45.     freopen("input.txt", "r", stdin);
  46. #endif
  47.  
  48.     ios_base::sync_with_stdio(false);
  49.     cin.tie(NULL);
  50.  
  51.     string word;
  52.     cin >> word;
  53.     string symbols;
  54.  
  55.     char last = '#';
  56.     for (char ch : word)
  57.     {
  58.         if (ch != last)
  59.             symbols += ch;
  60.         else
  61.             symbols.pop_back();
  62.         last = ch;
  63.     }
  64.  
  65.     cout << symbols << endl;
  66.  
  67.  
  68.     //system("pause");
  69.  
  70.     return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement