PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CCBCHBAHAI0000070. Đảo mảng bằng mảng phụ (Reverse an Array with an Auxiliary Array)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đảo mảng bằng mảng phụ (Reverse an Array with an Auxiliary Array)
Reverse an Array with an Auxiliary Array (Đảo mảng bằng mảng phụ)
Source: Problem Solving and Program Design in C
Version: Phuoc Hung OJ Extended
Problem
Given , create an auxiliary array of the same length such that
The source array must not be modified while constructing . Print .
Input
The first line contains . The second line contains integers .
Output
Print on one line.
Subtask
Subtask 1 (20 points): , .
Subtask 2 (30 points): , .
Subtask 3 (50 points): , .
Example
Input
6
4 -2 7 7 0 9
Output
9 0 7 7 -2 4
Explanation
The sample follows the mathematical definition above.