| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12138 | too many treasures |
|
| 12145 | Species of Knuckles |
|
| 12388 | Heatstroke Bamboo Rats |
|
| 12435 | Go Down Chicken |
|
| 12958 | ------ Midterm 1 Rules ------ |
|
Description
Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas accidentally found an undiscovered tomb. He successfully sneaked in without triggering any traps. When he finally got into the treasure room, he found a note that warns tomb raiders about the trap in the treasure room. Osas arranged the note and concluded some rules:
- The treasure room has n treasure crates, each crate has its value. The values are sorted in descending order.
- There are several intervals [l,r] on the note.
- Tomb raiders must loot less than or equal to m treasure crates in the correct interval, where m is a number that Osas have to guess.
- If any tomb raider loot more than m treasure crates or loot any crate that not in the interval, the trap would trigger and kill that tomb raider! Osas doesn't want to die here.
Osas wants these treasures, but he doesn't want to die. Osas wants to know if he pick one interval and guess a number as "m", what is the maximum value he could loot? Osas asks you for help!
Osas will give you the value of every treasure crate and the number he would like to guess, you need to write a program to help him.
Input
The input contains exactly one testcase.
The first line contains two integers n, q. q indicates the amount of queries of (l,r,m).
The next line is the sequence of values of n treasure crates, each seperated by a space.
The next q lines, each line contains exactly three integers l, r, m.
1<=m<=n<=106, 1<=q<=106, 1<=l<=r<=n, m<=r-l+1, the value of every treasure crate won't larger than 105 or smaller than -105. All of the values are integers. Notice that the value could be negative, and Osas can choose nothing.
Note that the sequence index starts from 1. For example: for a sequence "a": "3 4 5 6 7", a[4]=6, a[1]=3.
Output
For each query, output the maximum value Osas could get. Each query holds exactly one line.
Remember to print a '\n' at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
There're different kinds of Knuckles in this world. According to the research, there're 26 different kinds of Knuckles.
Let's denote different kind of Knuckles as 'a' ~ 'z'.
Knuckles is a magic creature.
If you have at least 2 same kind of Knuckles, you can transform these Knuckles into any kind of Knuckles with same number of them.
For example:
if you have n=3 Knuckles representing as "aab" you can transform 'a' Knuckles into 'b' Knuckles. In the end you will get "bbb" Knuckles.
Because you're a deadly Ethnic nationalism, you want all Knuckles to be the same.
You can do the transformation many times.
Find out whether you can do that.
NOTE: Case 6 limits the memory to 1 MB, so try not to declare a large array.
Input
Input contains two lines.
First line contains only one integer n( 1 <= n <= 107 ), representing the number of Knuckles.
Second line contains one string, the length of n.
Output
If you can make all Knuckles the same, output "I'm the god of Knuckles!"
Otherwise, output "Different makes perfect"
Remember to print \n at the end of output
Sample Input Download
Sample Output Download
Tags
Discuss
Description
This bamboo rat seems to have heatstroke, we might as well ......
── Brothers HuaNong
Brothers HuaNong feed a lot of bamboo rats. They do love to eat bamboo rats! However, some of the rats seems to have heatstroke. Brothers HuaNong couldn't bear to watch them suffer, and we all know how Brothers HuaNong treat those heatstroke rats...

Every bamboo rat has its level of heatstroke(中暑程度), Brother HuaNong would randomly choose a number . If there's a rat with level of heatstroke equals to , Brother HuaNong would think that the rat has heatstroke and eat it.
You are hired by Brothers HuaNong. Brothers HuaNong will give you the level of heatstroke of every bamboo rats and several numbers . Your task is to help them find out if there's rats that have heatstroke.
Hint: construct a binary search tree.
This problem is partial judge. You are going to implement the following functions:
void build_tree(Node **now, int *arr, int l, int r)When this function is called, you should build a binary search tree by the array
arr.int query_heatstroke(Node *now, int x)This function is used to ask if there exists a node with level equals to .
void eat_rat(Node **root, int x)This function will delete one node with level equals to .
Take sample as an example, initially, the level of heatstroke of the rats would be .
Firstly, , they will eat a rat with level equals 8. The sequence becomes .
: eat a rat with level equals to 10. The sequence becomes .
: eat a rat with level equals to 10. The sequence becomes .
: no rat with level equals to 200.
: no rat with level equals to 10(since all rats with level 10 are eaten).
Input
The first line is an integer , which indicates the number of bamboo rats.
The next line contains integers, indicate the level of heatstroke of every bamboo rat sorted in ascending order.
The third line is an integer , which means there are queries below.
There are lines below. Each line contains exactly one integer .
, , , the level of bamboo rats have the same range as .
Output
For each query , output "We might as well eat it." if there's a rat with level of heatstroke , otherwise output "No dinner tonight."
Sample Input Download
Sample Output Download
Partial Judge Code
12388.cPartial Judge Header
12388.hTags
Discuss
Description
"Go Down Chicken is a vicious monster, it will hit you until you have cerebral concussion(腦震盪)." ~from an anonymous bestiary.
To avoid from being attacked by Go Down Chicken, you need to solve the following problem.
This question has multiple input in each testcase. The input end with EOF.
Each input contain n numbers ai(1 <= i <= n) and q queries xj(1 <= j <= q).
Each number ai represents a game.
The game is that you need to fill a 3 * ai tiles with the shape(The left one) described in the picture below.
The shape can't overlap and no empty space allow. For each ai you need to calculate how many ways you can fill the tiles.
The number of ways may be very large, therefore you need to mod the answer with 1000000007.
For example:
The picture above present a 3*6 tiles, you will have 8 ways to fill the tiles with the shape.
Once you finish those n games, you need to answer q queries.
Each query will give you one integer xj means the ways to fill the tiles.
You need to answer xj is in which round of the games?
If there're multiple answers, answer the earliest round.
If you can't find the answer, print "Go Down Chicken 404"
Sample input explain:
You have n = 5, q = 3
Then you have 5 integer: 6, 9, 13, 4, 3
If the tiles is 3*6: you have 8 ways to fill it.
If the tiles is 3*9: you have 0 ways to fill it.
If the tiles is 3*13: you have 0 ways to fill it.
If the tiles is 3*4: you have 4 ways to fill it.
If the tiles is 3*3: you have 0 ways to fill it.
Then you have 3 queries: 0, 4, 1024
There are multiple rounds turn out have 0 ways, but you need to answer the earliest round. The earliest round is second round.
Therefore the answer is 2.
The round that turns out have 4 ways is the forth round.
Therefore the answer is 4.
The round that turns out have 1024 ways can't be found.
Therefore the answer is "Go Down Chicken 404".

Input
The input is end with EOF
Each input contains several lines.
First line contains two integer n(1 <= n <= 1000000), q( 1 <= q <= 1000000).
Second line contain n integer ai( 1 <= ai <= 1000000).
Each ai is followed by a symbol "(/`A`)/ ~I__I" and separated by a blank from the next integer.
The following q lines each line contains one integer xj .
Output
For each query print that xj is the result of which round of the games(start from 1).
If there're multiple answers, answer the earliest round.
If you can't find the answer, print "Go Down Chicken 404"
Sample Input Download
Sample Output Download
Tags
Discuss
Description
-
C language is the only allowed programming language. Solving problems with other languages (e.g. C++) are forbidden, otherwise you'll get zero point.
-
Paper references, electronic devices, or other items that may contain any information relative to this exam are not allowed.
-
Before leaving, please tell TAs, we'll check if your accepted / partially accepted submissions are all written in C. After you pass the check, you may sign your name as a record and leave.
-
The score of each problem is shown below:
-
12145:
6 points -
12138:
4 points -
12388:
6 points -
12435:
4 points
-
If you get partially correct in a problem, your score of the problem will be
-
score of the problem*number of testcases you passed/number of testcases
For example, if score of a problem is 10, which contains 6 testcases, and you pass the 3 testcases, you'll get 10*3/6=5 points on this problem.