Problem 2615 --Basic Modifications - Reverse

2615: Basic Modifications - Reverse

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $11$ 正确数量 $11$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL
Reverse Write a program which reads a sequence of integers A={a0,a1,...,an−1} and reverse specified elements by a list of the following operation: reverse(b,e): reverse the order of ab,ab+1,...,ae−1
The input is given in the following format. n a0 a1...,an−1 q b1 e1 b2 e2 : bq bq 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 two integers biei 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.
8
1 2 3 4 5 6 7 8
2
1 6
3 8
1 6 5 8 7 2 3 4
1≤n≤1,000 −1,000,000,000≤ai≤1,000,000,000 1≤q≤1,000 0≤b

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

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] AOJ大管家 436727 2019-06-06 12:50:56
内存最少[$2016 $KB] 刘 涛 338840 2018-12-06 09:37:50
第一AC 计爱玲 281645 2018-10-07 14:21:23
第一挑战 计爱玲 281645 2018-10-07 14:21:23

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

竞赛编号 竞赛名称 竞赛时间 访问比赛