| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12154 | You shall not pass! |
|
| 12178 | Queens and Castles |
|
| 12179 | Queens |
|
| 12194 | de way to home |
|
| 12237 | TA's Heartfelt |
|
Description
Attention: This problem uses partial judge to judge your answer!
One day, Knuckles is on his way for finding his queen. He encounters an old wizard, murmuring "You shall not....You shall not....". Knuckles decides to ignore the crazy wizard and continues his journey. Suddenly, that old crazy wizard blocks his way and says "YOU SHALL NOT PASS!!!"
The wizard, who is actually the legendary wizard Gandalf, is guarding this path. But Knuckles dones't care much. What he only cares is that the old man just blocks his way to his queen, which makes him very mad, and launches a duel to Gandalf.
This is a real man duel for spitter to wizard, sputum to magic spell, mysterious creature to man, legend to legend, a duel that whoever wins will change the whole world...... .
After minutes of fighting, they both feel tired, so they makes an agreement: Gandalf will cast his strongest spell to attack, and Knuckles needs to defend it. If Knuckles defends successfully, Knuckles wins; otherwise, Gandalf wins.
Gandalf will cast a spell "Pegasus Meteor Spell(天馬流星咒)". The spell will summon meteors from Pegasus and hit the ground hardly. The meteors will hit in a n*n square range. Knuckles needs to stop all the meteors, otherwise he'll be hit and lose the fight.
Knuckles will use "Sputum of the North Star(北斗神痰)" to defend. He will spit k sputum. Each time he spit, the next sputum will be more powerful. In other word, the power of sputums is sorted in ascending order.
He's going to spit on every meteor that falls onto the ground. The power of his sputum must be equal to or more powerful than the meteor he spits to destroy the meteor. If he spits a sputum that is weaker than the target meteor, the meteor will directly fall onto Knuckles' head and he'll lose. That is, each meteor can be spitted only once.
Knuckles will give you n, k, the power of each meteor and where will it fall, the sequence of the power of his sputum. You're going to tell him if he could win this fight or not.
- There are some meteors falling in a n*n area. The meteor's power of section (i,j) is denoted as "M(i,j)". There's no meteor if M(i,j) = 0.
- You have a sequence of sputum denoted as "S(i)", sorted in ascending order.
- If any sputum S(i) >= M(j,k), meteor M(j,k) can be destroyed by sputum S(i). At the same time, the sputum S(i) will be brken, too, which means that you can only use one sputum once.
- If all of the meteors can be destroyed (which means all elements in M are 0), Knuckles wins. Otherwise, he loses.
Input
The first line contains two positive integer n and k.
The next n lines, each line contains exactly n numbers, indicating the power of the meteors which will fall onto this place. 0 means no meteor will fall on this place.
The last line contains k numbers, which indicate the power of every sputum. As the description says, the power will be in ascending order.
1 <= n <= 100, 1 <= k <= n*n, and the power of meteors and the power of sputums will be in range [1,10000].
Output
You should output only one line. If Kunckles wins, output "Victory belongs to the Spitters!", otherwise output "Fly you fool."
Sample Input Download
Sample Output Download
Partial Judge Code
12154.cPartial Judge Header
12154.hTags
Discuss
Description
Long long long long long long long long long long time ago, there's a lovely kingdom named "Chess". There's King, Queen, Knight, Castle, Bishop, ...etc. Just like the modern game "chess".
A king possessed one or more castles, and likewise a king could have two or more queens (same as queen, a queen is able to have two or more kings). Now in this kingdom, the king has N queens and M castles. All the castles are male, and of course, all the queens are female.
Moreover, the queen would eventually fall in love with castles, castles would eventually fall in love with queens, queens would eventually fall in love with other queens, castles would eventually fall in love with other castles.(This is a diversified world, BL or GL could happen.) Queens and castles concerned that if the king found betrayal by which giving a large green hat, they will not be forgiven.
Queens and castles assign a secret mission to you, the mightily programming knight. They'd like to figure out the possibilities that the king was unaware their relationship in the palace.

- There are N queens and M castles in the palace.
- The palace is just like a chessboard with size (N+M)*(N+M).
- Queen can see all people in 8 directions(←, ↑, →, ↓, ↖, ↗, ↘, and ↙. Just like what queen in the chess does). If any queen see castles or other queens, the mission will fail.
- Castle can see all people in 4 directions(←, ↑, →, and ↓. Just like what castle in the chess does). If any castle see queens or other castles, the mission will fail.
- Find out the total amount of states that all queens and castles are placed in the palace and mission isn't fail.
Input
The input contains exactly two numbers N and M, each seperated by a space.
1 <= N+M <= 9.
Output
Output only one number ── the total amount of states that queens and castles are placed in the palace and mission isn't fail.
Remember to print a '\n' at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Long long long long long long long long long long time ago, there's a lovely kingdom named "Chess". There's King, Queen, Knight, Castle, Bishop, ...etc. Just like the modern game "chess".
A king definitely have not only one castle or knight. But no one says that a king shouldn't have two or more queens (same as queen, a queen is able to have two or more kings). Now in this kingdom, the king has N queens.
However, all the queens want to get the title "King's favorite", if one is uglier than the other one (which is judged by the king), then just win by manner. If one is more rude than the other one, then just win by skills. But if a queen loses on everything...... then just let them disappear or die "accidentally"...HEHEHE..... The king soon realized that, for the safety of all of his lovely queens, he must make them cannot see each other.
Now, the king ask you, the mighty programming knight, for a mission. They want to find out how many possibilities that the queens won't launch a war in the palace.
- There are N queens in the palace.
- The palace is just like a chessboard with size N*N.
- Queen can see all people in 8 directions(←, ↑, →, ↓, ↖, ↗, ↘, and ↙. Just like what queen in the chess does). If any queen see other queens, the mission will fail.
- Find out the total amount of states that all queens are placed in the palace and mission isn't fail.
Warning! Do not just look up the answer table! You are supposed to solve this problem by recursive. Otherwise you will regret it!
Input
The input contains exactly one number N.
1 <= N <= 14.
Output
Output only one number ── the total amount of states that queens are placed in the palace and mission isn't failed.
Remember to print a '\n' at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Ovuvuevuevue Enyetuenwuevue Ugbemugbem Osas go out hunting some animals for survival. However, he accidentally found some Ugandan children lost their way home.
After investigation, Osas found that they all have the same first name as him, which is "Ovuvuevuevue Enyetuenwuevue Ugbemugbem", but with a number last name. Not too long he found their village.
In this village, all the house has its number id. Osas supposed that if a child's last name, which is a number, matches one id of that house, the child must live in this house. Osas also found that the ids of these house are sorted in ascending order.
Now, Osas would like to ask you, the invincible programming chief of the village, the home way of these children's.
- Given a sequence <a> with n numbers, which are the id of these houses, in ascending order.
- Give you q queries, each query contains one number, you are going to answer if the number exists in the sequence <a>.
- If the number is in the sequence, output "I know de way to your home." Otherwise output "Wake up, you homeless poor."
Input
The first line contains exactly two numbers, indicates n and q described above.
The next line is the sequence <a> in ascending order, which contains exactly n integers.
Then there are q lines below. Each line contains exactly one integer, indicates the query.
1 <= n <= 106, 1 <= q <= 106, 1 <= ai <= 109, each query won't larger than 109 or smaller than 1.
For the first 4 testcases, n will not exceed 100, while n of the last 2 testcases is up to 106.
Output
For each query, if the number exists in the sequence <a>, then output "I know de way to your home." Otherwise output "Wake up, you homeless poor."
Sample Input Download
Sample Output Download
Tags
Discuss
Description
"Oh, no! The problem is so hard! No, no, no... Am I too stupid?"
"Hey, my code is right! Why do I always get a WA or TLE?"
"The method is difficult to understand, why are TAs always give us such a hard problem?"
"Did you heard that? I heard that the problem of the other professorss course is far more easier..." "Really? I should have chosen the other course..."
Yeah, we TA all know that it's hard for you to understand these new concepts. However, we do hope you to learn some knowledge that is important or useful. Such as "Prefix Sum", you can pre-calculate all the sum of (1,i) to get any sum of (i,j), which is far more faster than calculate the sum using for/while... right?
What about gcd or fast power(快速冪)? I think all of you may learn the split phase division(輾轉相除法), so it should be not too hard to you guys to learn that, right? For the part of fpw(fast power), it's not too hard to realize how it works, which is also wonderful that we could calculate nm or the n-th Fibonacci number so fast, even without include<moon>!
We do hope you guys could enjoy learning these interesting concepts instead of just taking the course, getting an A/A+, and treat this course as a part of your 4.3 GPA.
If you don't want to learn these extra knowledge, or you're too busy to learn, you can just submit a brute-force solution without using any of the concepts above, you can still pass 3-5 testcases(only if the method is right).
So now, we're going to have another question. Don't worry, you can get an AC by brute force (though that would be a little difficult).
You guys have learned IEEE floating point number, right? If you forget it, rewind it, please. Our problem won't become easier for you :(
- You are given a IEEE-754 floating number with single precision(which is type "float" in C)
- You are going to output every bit of the number, from the largest bit to the smallest bit (including every 0)
- Note that scanf("%f", &x); will automatically parse scientific numbers into floating point number, so you don't have to implement this part.
Hint.1: You may solve this problem by using pointer tricks extremely easily. However, you can still solve this by using traditional way. :)
Hint.2: You may refer to this page to check the binary of a fp number.
Enjoy!
Input
The input contains multiple testcases, which means we'll input several floating point numbers, ended by EOF.
Note that there may be precision error due to the precision of floating point number. What we want you to output is the binary bits of the floating point number stored in C variable.
We recommand to use scanf as your input function.
You can take a look and observe the sample IO.
The range of the floating point number is -1020 ~ 1020.
Output
Output every bit of the floating point number. Remember to print a '\n' at the end of every output.