TopCoder

User's AC Ratio

100.0% (1/1)

Submission's AC Ratio

100.0% (1/1)

Tags

Description

木瓜也在考「最佳化睡眠」的期中考,它剛好坐在神奇海螺的後面,所以看到了桃子傳給神奇海螺的答案。
聰明的木瓜一眼就看出桃子的答案不是奇數位與偶數位交換,而是整個答案陣列要反過來看。

請在程式碼最前面引入標頭檔 lib0627.h,並實作以下功能:

  • void array_reverse (int *head, int *tail)
    • arr 是一個 int 陣列,head 指向 arr 的頭,tail 指向 arr 的最後一項。
    • 請把 arr 這個陣列反轉。

注意此題不需要任何的輸入與輸出,否則將會發生不可預期的結果。

如果不確定該如何進行,可以參考以下的程式碼進行修改:

#include "lib0627.h"

void array_reverse (int *head, int *tail)
{
    // your code
}

Input Format

Output Format

Sample Input 1

5
1 2 3 4 5

Sample Output 1

5 4 3 2 1

Hints

測試用標頭檔
這裡提供一份本地測試用的標頭檔,你可以將其複製下來存檔成 lib0627.h#include "lib0627.h" 做使用。但請注意,這只是測試用的標頭檔,一些與解題無關的行為將會與 judge 上的有所不同,因此請不要嘗試任何與解題無關的行為,很可能會導致各種不可預期的後果。

Problem Source

Subtasks

No. Testdata Range Constraints Score
1 0 範例測資 0
2 0~6 無額外限制 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 524288 65536 1 2
1 1000 524288 65536 2
2 1000 524288 65536 2
3 1000 524288 65536 2
4 1000 524288 65536 2
5 1000 524288 65536 2
6 1000 524288 65536 2