很简单,直接暴力模拟就行了,k对len取个模更快
#include <cstdio>
#include <iostream>
using namespace std;
char s1[19999];
char s2[19999];
int main()
{
freopen("cyclic.in","r",stdin);
freopen("cyclic.out","w",stdout);
scanf("%s",s1);
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
int l,r,k;
scanf("%d%d%d",&l,&r,&k);
k%=(r-l+1);
if(!k) continue;
for(int j=l-1;j<=r-1-k;j++)
s2[j+k]=s1[j];
int now=l-1;
for(int j=r-k;j<=r-1;j++)
s2[now++]=s1[j];
for(int j=l-1;j<=r-1;j++)
s1[j]=s2[j];
}
puts(s1);
return 0;
}