-
Codeforces Round #449 (Div. 2) - A. Scarborough Fair코드포스(CodeForce) 2018. 8. 17. 17:33반응형
1. 문제
2. 알고리즘
키워드 -
3. 코드
12345678910111213141516171819202122232425262728293031323334353637#include <cstdio>#include <cmath>#include <queue>#include <cstring>#include <string>#include <iostream>#include <algorithm>using namespace std;int main(){int n, command;cin >> n >> command;string word;cin >> word;for (int i=0; i<command; i++) {int left, right;cin >> left >> right;char c1, c2;cin >> c1 >> c2;left -= 1;for (int j = left; j<right;j++) {if (word[j] == c1) {word[j] = c2;}}}cout << word << endl;return 0;}cs 반응형'코드포스(CodeForce)' 카테고리의 다른 글