2434 - I2P(I)2021_Yang_hw8 Scoreboard

Time

2021/11/23 20:30:00 2021/11/30 18:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11253 String Left Shift
12460 Little Brick's Choice
12498 Partial Judge Example
12510 Hakka's Maze

11253 - String Left Shift   

Description

Given a string S, you are going to shift part of it.
Specifically, a shift on a string is to move all the characters left but the leftmost characters would be move to the rightmost.
For example, a shift on "abcd" would result in "bcda".

This problem ask you implement a function shift(char *start, char *end) that shift a substring of S starting from start to end.

1.      This problem involves three files.

  • function.h: Function definition of shift.
  • function.c: Function implementation of shift.
  • main.c: A driver program to test your implementation.

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

  • 2.     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 first line is a string S. (length of S<=20)
The second is a integer n. (n<=10)
The next n lines, each contains two integers l and r.(l<=r<=n)
This means that a shift on S[l]S[l+1]...S[r].
If the length of substring is one(l=r), then you should keep the string unchanged.
All these shift must be done in order.

 

Output

The result string after all n shift operations.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11253.c

Partial Judge Header

11253.h

Tags




Discuss




12460 - Little Brick's Choice   

Description

Little Brick(小磚頭) once wanted to register an account on a webpage,
however, he didn't know what password he should use,

he wanted his password in increasing ASCII code order,
and he listed some characters that he wanted to use in the password,
can you show all possible passwords that he can choose.

That is, a valid password must contain 4 or more characters and be in an increasing order of ASCII code,
Every character in the list can only be used once.
You must list all possible passwords in lexicographical order.

ouo.

Lexicographical Order: Given two different sequences, if two words have the same first letter, we compare the second. If the second letters are the same, we compare the third, etc. Finally, one word comes before the other if the first differing letter comes before the corresponding letter. If two words are identical up to the length of the shorter word, the shorter word comes first.

For example, if the input is "acebd", then you should output
abcd, abcde, abce, abde, acde, bcde
Note that "abed" is not valid since characer 'e' should be after 'd',
and "abd" is not a valid password too because its length is only 3.

Note that the ASCII codes for 'A'-'Z' are 65-90 and for 'a'-'z' are 97-122.

Input

Input contains only 1 line, representing the list of some characters that can be used in the password.

It is guaranteed that the characters will not be duplicated,
and 4 <= length of the given list <= 18, and the characters will only be lowercase or uppercase alphabet.

Output

Output contains only one line.

List all possible passwords in lexicographical order, separated by ", " (without quotes)

Remember to add a newline character after your output.

Sample Input  Download

Sample Output  Download

Tags




Discuss




12498 - Partial Judge Example   

Description

This is the partial judge example (another method for online judge), you are asked to design a function below:

int call_add(int a, int b);

(implement a function to add two pass value togeter)

Note: for OJ partial judge 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.

/* the content below is what you need to copy and submit to oj*/

int call_add(int a, int b){

        return a + b;

}

More information about the different of partial judge and normal judge

Input

Please refer to the main function.

The input only one line, contain two number a and b  (1 < a < 10, 1< b < 10)

Output

Output a + b. 

Sample Input  Download

Sample Output  Download

Partial Judge Code

12498.c

Partial Judge Header

12498.h

Tags




Discuss




12510 - Hakka's Maze   

Description

In the village of hakka's, there are lots of big big mazes,
it is said that the delicious hakka mochi(麻糬) is hidden in one of the secret maze.

You, a poor programmer, work for hakkas without getting any paid,
want to find out the secret, and change the job to selling mochi,
since being a programmer is too tired, and may be died overworked.
So, one day, you sneaked into the village head's house, and stolen all the mazes' maps out.

You have got T maps,
and each map shows that the maze is N*M grids big,
and start from (1,1) (the left top corner), and the mochi is at (N,M) (the right bottom corner),
the '#' on the map represent the wall,
and the '*' on the map represent that you can walk pass that grid,
and the 'T' on the map represent the teleport device.

Walking in the hakka's maze, start from the starting point,
if you are standing on a road,
you can go to the up, right, left, or the bottom grid near you,
you cannot be on the wall,
and if you are standing on a teleport device,
you can go to the up, right, left, or the bottom grid near you, too,
but you can also teleport to any other teleport device.

You want to make sure the if it is possible to walk from the starting point (1, 1) to the ending point (N, M) of each map,
so you won't waste time finding the mochi.

ouo.

For Example, if the input is:
1
3 3
***
*#*
##*
The output should be 'Yes' (without quotes),

since you can go (right, right, down, down) to get to the ending point of the map.


 

Input

The first line of the input is a number T,
represent the amount of map you have.

Start from the second line, there are T maps,
the first line contains 2 number N, M, represent the maze is N*M big,
then the following N lines are M characters,
the character '#' represent the grid is a wall,
the character '*' represent the grid is a road,
the character 'T' represent the grid is a teleport device.

It is guarantee that,
for all test cases, T <= 10, 2 <= N, M <= 1000,
for the 1 test case, 2 <= N, M <= 10,
for the 2, 3 test cases, 2 <= N, M <= 200
for the 3, 6 test case, there are no teleport device.
for the 4, 5, 6 test cases, 2 <= N, M <= 1000
and (1, 1) will not be a wall.

Output

Output T lines,
if it is possible to walk from the starting point to the end point,
output 'Yes', otherwise, output 'No'. (Without quotes)

Sample Input  Download

Sample Output  Download

Tags




Discuss