循环移动
来源:互联网 发布:div加载完成后执行js 编辑:程序博客网 时间:2024/05/21 16:22
很简单,直接暴力模拟就行了,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;}
阅读全文
0 1
- 循环移动
- 循环移动
- 循环移动
- 循环移动
- 循环移动
- 循环移动
- 循环移动的图片
- 循环移动的图片
- 数组数据循环移动
- 循环移动问题思考!
- 循环移动字符串
- 循环移动数组元素
- 字符串循环移动
- 字符串循环移动
- 纹理贴图循环移动
- 循环移动字符串
- 数组循环移动
- 循环移动背景类
- YOLO_V2的region_layer LOSS损失计算源码解读
- Maven 入门
- 文件各种上传,离不开的表单
- 关于KVM一些概念
- STL string源码剖析
- 循环移动
- Git 命令切换分支
- Tomcat启用HTTPS协议配置过程
- 循环移动(cyclic)
- Mybatis 源码分析
- delphi里怎样取消窗体的关闭按钮
- PAT甲级1005. Spell It Right
- Spring Boot实战【mysql安装】
- c++ new delete 常踩的坑