Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- #include <algorithm>
- using namespace std;
- int n;
- long long c;
- queue<long long> mq;
- int main()
- {
- cin>>n;
- while (n--)
- {
- scanf("%lld", &c);
- if (mq.empty() || mq.front() != c)
- {
- printf("%lld\n", c);
- mq.push((c << 2) / 3);
- }
- else if (!mq.empty())
- mq.pop();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment