| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11686 | more simple exercise of pointer on array |
|
| 11691 | pC - Ponds |
|
| 12075 | Fire!!!!!!! |
|
Description
In this exercise, you should exchange the content of two given one dimensional integer arrays with same length.
We have written the code about reading the size and the content of arrays, and we want to pass them to a function for getting the final answer. What you need is helping us to complete the function.
What input into the function is two pointers representing the two arrays and the length of array, and the function has to exchange the content of the two arrays.
For more specific, you only need to implement the following function:
#include <stdio.h>
#include "function.h"
void array_exchanger(int* array_a, int* array_b, int length) {
// your code
}
The .c and .h file below might be helpful if you want to know how the function and the whole program works.
Input
The input may have 3 lines of input.
The very first line is a number, representing the length of 2 arrays.
The second and the third lines are several integers, representing the content of 2 arrays.
Output
The content in two arrays after exchanged.
Sample Input Download
Sample Output Download
Partial Judge Code
11686.cPartial Judge Header
11686.hTags
Discuss
Description
Writer: jjjjj19980806 Description: pclightyear Difficulty: ★★☆☆☆
Frank Lin likes to go mountain climbing. Every time before he goes mountain climbing, he needs to look up the map to plan for the route. According to Frank’s experience, it is very important to locate the position of ponds, since it is usually the best place for resting. Now, Frank gives you a map sized m ✕ n consists of only two symbols '~' and '.', representing water and land, respectively. Frank wonders how many ponds (consecutive position of water) are there on the map.
If you can help Frank solve this problem, maybe he will teach you how to build a tent within five minutes.
Input
The first line contains two integers m, n, representing the size of the map Frank gives to you.
The next m lines contain n characters, either '~' or '.', representing the status of position aij.
It is guaranteed that :
- 1 ≤ m, n ≤ 1000
Output
Please output the number of ponds on the map.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Writer: jjjjj19980806 Description: pclightyear Photo Credit: eccioa Difficulty: ★★☆☆☆

Fi - Fi - Fi - Fire!!!!!!!!!!!!
eccioa loves playing minecraft, but he is on fire now!
He looks at the mini map, and he wants to found out if there is any water nearby to put out the fire on him. Unfortunately, there is also some lava nearby, and he can't pass through it (he forgot to bring the potion of fire resistance). If he can't reach any of the water on the map, he will be burned to death miserably.
eccioa now gives you the mini map sized m ✕ n consists of four symbols:
'e' stands for the current position of eccioa.
'.' stands for the regular road he can pass through.
'^' stands for lava he cannot pass through.
'~' stands for water. (There may be multiple of them)
Can you tell him whether he can stay alive or not?
Input
The first line contains two integer m, n, representing the size of the map eccioa gives to you.
The next m lines contain n characters, either 'e', '.', '^', '~', representing the status of position aij.
It is guaranteed that :
- 1 ≤ m, n ≤ 1000
Output
If eccioa can stay alive, please print "Alive!", otherwise please print "Dead!".