분류 전체보기
-
1406) 에디터 c++백준코딩일기 2020. 11. 5. 12:55
문제 ) www.acmicpc.net/problem/1406 1406번: 에디터 첫째 줄에는 초기에 편집기에 입력되어 있는 문자열이 주어진다. 이 문자열은 길이가 N이고, 영어 소문자로만 이루어져 있으며, 길이는 100,000을 넘지 않는다. 둘째 줄에는 입력할 명령어의 개수 www.acmicpc.net 풀이 ) 코드 ) #include #include #include using namespace std; int main(){ int n; string s; cin >> s >> n; list l(s.begin(),s.end()); auto now = l.end(); while(n--){ char tmp; cin >> tmp; if(tmp == 'L'){ if(now != l.begin()){ now--;..