题解 | #游游的字母翻倍#

游游的字母翻倍

https://www.nowcoder.com/practice/cd02bff88b6f4f4fba264dccdb78705d

字符串模拟

n,q=map(int,input().split())
s='?'+input()
for _ in range(0,q):
    l,r=map(int,input().split())
    s1=s[:l]
    s2=s[l:r+1]
    s3=s[r+1:]
    tmp=[i+i for i in s2]
    s4=''.join(tmp)
    s=s1+s4+s3
print(s[1:])
全部评论

相关推荐

没有奇迹的世界:简直世另我 一样的先学后端再转前端一样的简历模板 绷不住了甚至描述都这么像 值得庆幸的是你才28届 加油
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务