백준 3986 c++1 백준 3986번 - 좋은 단어 https://www.acmicpc.net/problem/3986 3986번: 좋은 단어 이번 계절학기에 심리학 개론을 수강 중인 평석이는 오늘 자정까지 보고서를 제출해야 한다. 보고서 작성이 너무 지루했던 평석이는 노트북에 엎드려서 꾸벅꾸벅 졸다가 제출 마감 1시간 전에 www.acmicpc.net #include using namespace std; int n, cnt; string word; bool goodWord = true; int main(){ cin >> n; for(int i=0; i> word; stack st; for(char c : word){ if(!st.empty() && st.top() == c){ st.pop(); }else{ st.push(c); } } if(st.empty.. 2023. 8. 25. 이전 1 다음