| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12141 | Ugandan Knuckles's code |
|
| 12144 | Dark Souls |
|
| 12305 | Airplane Shooter |
|
Description
Ugandan Knuckles is trapped in a dungeon. He wants to find his queen. He finds a stele (碑) that there are n strings on it. You can move the strings in any order you want.
The way to go out is that for each string, all strings placed before it are its substrings.
For example:
If the stele contains strings:
"n"
"ugandan"
"ganda"
"gan"
You should arrange the strings into the order:
"n"
"gan"
"ganda"
"ugandan"
Help Knuckles get out of the dungeon or he will spit on you.
Input
Input contains several lines.
First line contains only one integer n (1<= n <= 1000)
Following n lines, each line contains one string s ( 1<= length of s <= 1000 )
The string s only contains lowercase English letters.
Output
If it's impossible to arrange the strings in the desired order, print "NO".
If it's possible, print "YES" .
And then print n lines each line contains one string in required order.
Remember to print \n at the end of output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Dark Souls is a famous video game. The main character in Dark Souls 3 is known as
" Ashen one ". Today you are the Ashen one.
You are in a 5*5 room. You are at the
position ( 1, 1 ) -- the top left corner -- and you want to reach the
position ( 5, 5 )-- the lower right corner.
There's no obstacle in the room but monsters. If you and the monster are at the same position, you need to fight it.
The rule of fighting is Turn-based. You can always attack first, if the monster didn't die after your attack, then it's the monster's turn to attack you and so on.
There is always only two result after a fight, you died or the monster died.
Note that once you lost your hp you can't restore it.
Find out if you can reach the position ( 5,5 )
Input
input contain servel lines.
First line contains three integers.
The Hp, attack of Ashen one and k( 1 <= k <= 25 ) the number of monsters.
Following k lines each lines contains four integers.
The Hp, attack of i-th monster and the position x,y of i-th monster.
All numbers are >= 1 and in the range of int
Output
If you can reach the position ( 5 ,5 ) print "HEIR OF FIRE DESTROYED"
otherwise print "YOU DIED"
remember to print \n at the end of output
Sample Input Download
Sample Output Download
Tags
Discuss
Description
It's a beautiful day outside. birds are singing, flowers are blooming... on days like these, kids like you... Should be burning in hell. Uhhhh... I mean, nothing, literally. (original: undertale sans dialogue)
Even such a beautiful day like this, we shall watch out for the chance that there might be bombing plane bombing our campus. That's why we need our fortification, that is, the well-known "Airplane Shooter".

"The True Appearance of the Airplane Shooter" PC by TA
However, living in this "peaceful" era, we don't actually need to worry about bombing planes or "Little Boy" or somethin else like that. The Airplane Shooter is no longer be needed, so the school committee decided to turn it to a "public art", everyone is able to get closer to our legendary Airplane Shooter.
Nothing lasts forever. Some "fart child" use it to flash those unfortunate passers. The famous Airplane Shooter has also become the infamous "Moto-shooter".
Now, Knuckles is going to shoot(flash) those goddamnpoor motorcycles down because those motorcycles block his way of finding his queen.
Knuckles could recognize the owner of every motorcycle. He prefers to shoot those school administration staffs first, especially the president. If their administration level are the same, he would like to shoot those motorcycles with smaller license plate number(which is literally a "number").
Given the sequence of those motorcycles and their infos, you are going to tell Knuckles the order of shooting down.
-
Given a sequence
a. The elements ofahas the following infomations:-
index: The index is followed by the input order, starts from 1. The input won't containindex, you have to record it yourself. Smaller inputindexhas higher priority. -
admin level: Level starts from 0 to 999. level 0 has the highest priority, while level 999 has the lowest.level 0: presidentHong Hochenglevel 1: stuff of different school affairslevel 2: junior sister(學妹)level 3: senior sister(學姊)level 4: senior brother(學長)level 5: campus stray dogs/catslevel 6: squirrellevel 7: pigeon- ......
level 999: junior brother(學弟)
-
license number: An integer. Smaller number has higher priority.
-
-
You are going to sort
a. Element with higher priority brings to the front. Compareadmin levelfirst, thenlicense number, thenindex. -
Output
index(the old one) of every element in the newa.
Input
The first line contains an integer n, indicates the number of elements in a.
There are n lines below. Start from the first line of the n lines, the i-th line contains the i-th information. Each line contains 2 integers admin level and license number.
1 <= n <= 105, 0 <= admin level <= 999, 1 <= license number <= 109
Output
Output the old index of every element in the new a respectively, each separated with a space
Note that there should be no space after the last number but a '\n'.