题目出处:http://codeforces.com/problemset/problem/897/A

题目大意:将某个范围内的某个字符换成另外一个字符

#include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
string s;
cin>>s;
while(m--){
int l,r;
char in,out;
cin>>l>>r>>in>>out;
for(int i=l-;i<r;i++) if(s[i]==in) s[i] = out;
}
cout<<s;
return ;
}

897A. Scarborough Fair# 斯卡布罗集市(模拟)的更多相关文章

  1. yzoj P2344 斯卡布罗集市 题解

    共t条街对于每一条街上有n个店铺(n可能不相同),每次只能选两端第一个营业的店铺采购,采购第i个店铺会获得幸福度ai,采购完后,这个店铺和它相邻的店铺便会关门,问最大幸福度? 考场想了一下dp,一开始 ...

  2. codeforces 897A Scarborough Fair 暴力签到

    codeforces 897A Scarborough Fair 题目链接: http://codeforces.com/problemset/problem/897/A 思路: 暴力大法好 代码: ...

  3. Codeforces Round #449 (Div. 2)-897A.Scarborough Fair(字符替换水题) 897B.Chtholly's request(处理前一半) 897C.Nephren gives a riddle(递归)

    A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  4. 英语音乐---一、Scarborough Fair

    英语音乐---一.Scarborough Fair 一.总结 一句话总结:斯卡布罗集市 <斯卡布罗集市>诉说了一个缠绵凄美的爱情故事:一个参军的男青年远离自己相爱的姑娘在战争中不幸遇难,但 ...

  5. 龙珠超·布罗利【MGRT&幻之】【720P】剧场版

    [上传]龙珠超·布罗利[MGRT&幻之][720P]剧场版 这是一个,全新的“赛亚人”故事.“力量大会”之后,和平的地球.悟空了解到宇宙中还存在着自己未曾见过的强者,于是每天都为了变得更强而不 ...

  6. Codeforces Round #449 (Div. 2) A. Scarborough Fair【多次区间修改字符串】

    A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  7. Scarborough Fair 绝美天籁

    很少见的男声唱法,而且还古色古香: https://www.youtube.com/watch?v=sgbo2QWLBzI https://www.youtube.com/watch?v=-BakWV ...

  8. Python matplotlib numpy 曼德尔布罗特集合 曼德尔布罗特 B.Madelbrot

    import numpy as np import matplotlib.pyplot as plt def mandelbrot(h,w,maxit=20): y,x = np.ogrid[-1.4 ...

  9. 罗大佑 光阴的故事 ZT 欧美经典歌曲100首(1-50)

    老俞 my idol ———————————————————————————————— 罗大佑 光阴的故事 歌曲光阴的故事为2008年入库,是罗大佑在2000-1-1发行的专辑<情歌精选> ...

随机推荐

  1. jQuery网页定时弹出广告

    1.下载jQuery,并导入:https://blog.csdn.net/weixin_44718300/article/details/88746796 2.代码实现: <!DOCTYPE h ...

  2. Element.scrollIntoView() 和 document.elementFromPoint ()

    Element​.scroll​Into​View() 让当前的元素滚动到浏览器窗口的可视区域内 element.scrollIntoView(); // 等同于element.scrollIntoV ...

  3. iOS 保存图片(视频)到相册

    1.C语言函数方式实现 注意:UIImageWriteToSavedPhotosAlbum方法必须实现代理方法,否则会崩溃. //参数1:图片对象 //参数2:成功方法绑定的target //参数3: ...

  4. PyMySQL学习笔记

    一些常用函数及解释 db = pymysql.connect('host','user','password','database') # 连接数据库 cursor = db.cursor() # 创 ...

  5. js 数据

    非0数字值 都是true  0和NaN 都是false 任何对象   都是true  null       都是false undefined 不适用 详情

  6. 每天一点点之laravel框架开发 - passport授权报invalid_credentials

    {"error":"invalid_credentials","message":"The user credentials we ...

  7. 使用文件流创建File文件和目录以及其他的一些操作

    我们创建文件时可以直接通过File f=new File(path)来创建一个文件对象,然后再通过 f.createNewFile() 就创建出来了一个文件.比如设置 path 为 C:\Users\ ...

  8. ES6 之 函数的扩展 尾调用以及尾递归

    函数参数的默认值 function log(x, y) { y = y || 'world' console.log(x + ' ' + y); } log('hello') // hello wor ...

  9. windows下使用mysqlbinlog做数据恢复时出现mysqlbinlog: File 'D:\MariaDB' not found (Errcode: 2)

    出现如下这种情况是因为为找到bin-log日志,但为什么没有查到了??? 从图中可以看出系统只到到了D:\MariaDB但路径并没有查全,默认在windows下是以空格为分隔符的,所以他把D:\Mar ...

  10. 吴裕雄--天生自然 JAVASCRIPT开发学习:Array(数组) 对象

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...