wogks99   1년 전

초기에 vector를 사용해서 문제를 풀었는데 시간초과가 나서 deque를 사용해서 다시 푸니까 해결했습니다.

하지만 왜 vector를 사용하면 터지고 deque를 사용하면 안터지는지 모르겠습니다.

erase와 pop의 차이때문일까요? 너무 궁금합니다!!

shjohw12   1년 전

https://en.cppreference.com/w/...

Complexity

Linear: the number of calls to the destructor of T is the same as the number of elements erased, the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements

댓글을 작성하려면 로그인해야 합니다.