Problem 2616 --Basic Modifications - Rotate

2616: Basic Modifications - Rotate

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $22$ 正确数量 $17$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL
Write a program which reads a sequence of integers A={a0,a1,...,an−1} and rotate specified elements by a list of the following operation: rotate(b,m,e): For each integer k (0≤k<(e−b)), move element b+k to the place of element b+((k+(e−m))mod(e−b)).

The input is given in the following format. 

a0 a1...,an−1

 q 

b1 m1 e1

b2 m2 e2 

bq mq eq 

In the first line, n (the number of elements in A) is given. In the second line, ai (each element in A) are given. In the third line, the number of queries q is given and each query is given by three integers bimiei in the following q lines.

Print all elements of A in a line after performing the given operations. Put a single space character between adjacency elements and a newline at the end of the last element.
11
1 2 3 4 5 6 7 8 9 10 11
1
2 6 9
1 2 7 8 9 3 4 5 6 10 11
1≤n≤1,000 −1,000,000,000≤ai≤1,000,000,000 1≤q≤1,000 0≤bi≤mi

推荐代码 查看2616 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] AOJ大管家 436749 2019-06-06 13:11:56
内存最少[$2020 $KB] RUBY-WOO 360077 2019-01-14 22:23:11
第一AC 计爱玲 281672 2018-10-07 14:54:42
第一挑战 计爱玲 281672 2018-10-07 14:54:42

赛题来源/所属竞赛 会津大学《C++ Programming II》 C++程序设计(高级)

竞赛编号 竞赛名称 竞赛时间 访问比赛
1211 庆祝2018年10.24世界程序员节日欢乐AC赛(竞赛密码6的二进制)~ 2018-10-24 10:24:00 请登录