ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1654. Cipher Message

use printf() instead of cout and string instead of char if you use c++ stl
Posted by Haloom 16 Jun 2018 23:42
i used deque. cout got me TLE.using printf save me.

      if(st.front()!=s[i])
        {
            st.emplace_front(s[i]);
        }
        else
            st.pop_front();


for(it=st.end()-1; it>=st.begin(); it--)
    {
        printf("%c",*it);
    }
Re: use printf() instead of cout and string instead of char if you use c++ stl
Posted by bstu_student 9 Aug 2018 09:08
i say more - it's better don't use stl-containers if it's possible.
char[200001] gives perfect time