codeforces 598B Queries on a String
题目链接:http://codeforces.com/problemset/problem/598/B
题目分类:字符串
题意:给定一个串,然后n次旋转,每次给l,r,k,表示区间l到r的字符进行k次平移,具体移动规则看题意,求经过n次旋转之后字符串是怎样的
题目分析:自己的做法比较麻烦,后来发现别人用函数给做出来了,贴代码
代码:
#include <bits/stdc++.h>
using namespace std; int m;
char s[]; int main()
{
scanf("%s",s+1);
scanf("%d",&m);
for (int i=;i<m;i++)
{
int l,r,k;
scanf("%d%d%d",&l,&r,&k);
k%=(r-l+);
rotate(s+l,s+r+1-k,s+r+1);
}
printf("%s\n",s+); return ;
}
codeforces 598B Queries on a String的更多相关文章
- Educational Codeforces Round 1 B. Queries on a String 暴力
B. Queries on a String Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/59 ...
- 「CodeForces - 598B」Queries on a String
BUPT 2017 summer training (for 16) #1I 题意 字符串s(1 ≤ |s| ≤ 10 000),有m(1 ≤ m ≤ 300)次操作,每次给l,r,k,代表将r位置插 ...
- dp --- Codeforces 245H :Queries for Number of Palindromes
Queries for Number of Palindromes Problem's Link: http://codeforces.com/problemset/problem/245/H M ...
- codeforces:MEX Queries分析和实现
首先说明一下MEX,设S是自然数集合N的一个子集,那么S的MEX则为min(N\S),即不包含于S的最小自然数. 题目大意是存在一个空集S,提供n组输入(n<10^5),每组输入对应下面的一个指 ...
- CodeForces - 963D:Frequency of String (bitset暴力搞)
You are given a string ss. You should answer nn queries. The ii-th query consists of integer kiki an ...
- CodeForces - 600B Queries about less or equal elements (二分查找 利用stl)
传送门: http://codeforces.com/problemset/problem/600/B Queries about less or equal elements time limit ...
- codeforces ~ 1009 B Minimum Ternary String(超级恶心的思维题
http://codeforces.com/problemset/problem/1009/B B. Minimum Ternary String time limit per test 1 seco ...
- Codeforces 245H Queries for Number of Palindromes:区间dp
题目链接:http://codeforces.com/problemset/problem/245/H 题意: 给你一个字符串s. 然后有t个询问,每个询问给出x,y,问你区间[x,y]中的回文子串的 ...
- Codeforces Round #527 -A. Uniform String(思维)
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
随机推荐
- boost 分析命令行参数
#include <boost/program_options.hpp> #include <iostream> #include <vector> using n ...
- hdu4717 The Moving Points(二分做法)
这道题看了大家都是用三分做的,其实这道题也是可以用二分来做的,就是利用一下他们的单调性. 对于N个点,总共要考虑N(N+1)/2个距离,距离可以用二次函数表示,而且开口都是向上的. 下面具体说一下二分 ...
- ViewPageAsImage
var ViewPageAsImage = function(target, label) { var setting = { min_height: 4, min_width: 4 ...
- 一步一步重写 CodeIgniter 框架 (4) —— load_class 管理多个对象实例的思路
我们使用CodeIgniter 框架最主要是想利用其 MVC 特性,将模型.视图分开,并通过控制器进行统一控制.在尝试实现 MVC 模式之前,我们将实现其中一个对程序结构非常有用的技巧,就是 load ...
- properties 文件的中文转ASCII
在软件开发过程中,经常要涉及到多语言支持问题,常用的解决方案是将各个语言文字放到properties文件中,但中文是需要转为ASCII的 .那么如何将中文进行转换呢,下面就为你列举几种比较方便的方法 ...
- JQuery获取与设置HTML元素的值value
JQuery获取与设置HTML元素的值value 作者:简明现代魔法图书馆 发布时间:2011-07-07 10:16:13 20481 次阅读 服务器君一共花费了13.221 ms进行了6次数据库查 ...
- Spring Tool Suite(简称STS)针对SimpleDateFormat.pase函数的实参值不做检验,异常直接默认值之
Spring Tool Suite(简称STS)是 Spring 团队开发的一款基于Eclipse的IDE,旨在简化开发Spring MVC 应用的流程.可以自动生成spring相关的配置文件.比如a ...
- MyEclipse弹出提示窗体
MyEclipse弹出提示窗体 1.弹窗例如以下
- android源码地址及下载介绍
git clone https://android.googlesource.com/device/common.git git clone https://android.googlesour ...
- 组件状态(TComponentState)11种和组件状态(TComponentStyle)4种
TOperation = (opInsert, opRemove); TComponentState = set of ( csAncestor The component was introduce ...