1935 - I2P(II)2020_Lee_HW1 Scoreboard

Time

2020/03/07 00:00:00 2020/03/24 23:59:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11270 reverse linked list
12677 Hunter Likes Cypher :)

11270 - reverse linked list   

Description

Given a link list structure named Node.

 

typedef struct _Node {

    int data;

    struct _Node *next;

} Node;

Use this structure to implement a reversing linked list.

 

You will be provided with main.c and function.h, and asked to implement function.c.

For OJ submission:

       Step 1. Submit only your function.c into the submission block. (Please choose c compiler) 

       Step 2. Check the results and debug your program if necessary.

Input

The input contains a sequence of positive integers as the linklist and the order, except the last one, which is -1, indicating the end of the sequence. 

Output

The output contains the sequence of resulting linklist.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11270.c

Partial Judge Header

11270.h

Tags




Discuss




12677 - Hunter Likes Cypher :)   

Description

"wo jiau ni funky na ge niu hai i i i ~~~"

Hunter likes to dance, and joined the nthu pop dance club.

One day he asked Jeff , Joshua , Bena , Ricky ... to form a circle to cypher, they used to spin a bottle to determine who is the next one.

But today they want to do it in another way, they count from 0th member M times, so the (M-1)th member solos, when he/she finishes, he/she will be removed from the circle, and count from mth person m times again...

Until every members have soloed.

Now Hunter wanna know the solo's order, can you help him?

Input

There will be multiple testcases in each input file, but no more than 10

Two integer N, M, in first line, N means the numbers of members in the circle. 

And N integers Ai in the second line which means the index of ith member , 0 <= i < N , 0 <= Ai < N

1 <= N <= 5000
1 <= M <= 1000

Output

Output the solo's order.

Sample Input  Download

Sample Output  Download

Tags




Discuss