2199 - I2P(II) 2020_Chen_mid2_practice Scoreboard

Time

2020/12/08 18:30:00 2020/12/15 18:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12535 So beautiful
12537 The power of vector
12733 Salary thief
12823 Nyan Cat Crisis

12535 - So beautiful   

Description

Into the unknown~ ~ ~ ~

~ by anonymous queen

As a programmer, you know that into the unknown will cause your program fatal error. Although you despise the unknown behavior, you still like this song. You decide to study how lyric work.


Give you n words. Each word contains at least one vowel( 'a', 'e', 'i', 'o', 'u' ) and only contains lower case character.

Every four words can compose a lyric in two lines form.

Each line only contains two words and separated by a single blank.

A lyric is good if and only if:

  1. the first line's first word contains as many vowels as the second line's first word

  2. the first line's second word contains as many vowels as the second line's second word.

  3. the last vowel of first line's second word is same as the last vowel of second line's second word

EXAMPLE:

about proud

hooray round

This example is a good lyric.

Because "about" has 3 vowels so is "hooray",

"proud" has 2 vowels so is "round"

and the last vowel of "proud" is "u" so is "round".

Your task is finding how many good lyric can be composed from the n words.

Make the answer as big as possible.

Note: Each word can be only used for one time!

 

 

Download the C++ reference.
You will see the file named "12534.cpp" but that's OK.
Just download the file and change the filename extension(副檔名) into "zip" then you can upzip the file and use the reference.
The link is below.

reference.zip

Input

The first line contains only one integer n(1 <= n <= 100000)

The following n lines each lines contain only one string.

Each string's length will not exceed 200.

Output

Print the largest number of lyric that you can compose from n words.

Remember to print \n at the end of output.

 

Sample I/O explain:

14

wow

this

is

the

first

mcdics

codeforces

round

hooray

i

am

proud

about

that

You can compose at most three lyric:

about proud

hooray round

 

wow first

this is

 

i that

mcdics am

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




12537 - The power of vector   

Description

You are going to maintain a data structure V that each element is a int.

Give you n orders. There're four types of order

push_back:

The order will followed by a int. Push the int to the back of V.

pop_back:

Delete a int at the back of V .

If the vector is empty, do nothing.

find

The order will followed by a int means the index. Print the number V[ int ].

The index is start from 1.

If the index is invaild, do nothing.

min:

Print the smallest number in V. Print the number and its index. If you find multiple answer, print the number with smallest id.

If the vector is empty, do nothing.

max:

Print the biggest number in V. Print the number and its index. If you find multiple answer, print the number with biggest id.

If the vector is empty, do nothing.

 

 

Download the C++ reference.
You will see the file named "12534.cpp" but that's OK.
Just download the file and change the filename extension(副檔名) into "zip" then you can upzip the file and use the reference.
The link is below.

reference.zip

Input

The first line contains only one integer n(1 <= n <= 200000)

The following n lines each lines contains order as the description described.

Each number is in the range of int.

Output

For each order print as demand.

Remember to print \n at the end of each output.

Sample Input  Download

Sample Output  Download

Tags




Discuss




12733 - Salary thief   

Description

I'm a salary thief who don't answer students' question

~by anonymous TA

"I sucked!" TA think he's the worst, therefore he only asks you to do some cut and paste.


You got a string and your cursor is at the leftmost position of the string.

Let's call the leftmost position of the string position 0.

The string only contains character '1'~'3'.

You need to move the cursor to the right x times.

Each time only cross one character.

After the move, you divide the string into two part.

You cut the right part, and paste it for n times.

For n = the last character of left part of the string.

You need to answer how long the string is after x moves.

Because the string may be very long, you only need to answer the length of the final string mod 10^9+7(output positive number)

We guarantee that each move will not on empty character​. 

Example:

Given x = 5, string = "231"

Move 1(position 0->1):

cut the string "231" -> "2" and "31"

the last character of left part of the string = "2"

past "31" for 2 times, we got "23131"

Move 2(position 1->2):

cut the string "23131" -> "23" and "131"

the last character of left part of the string = "3"

past "131" for 3 times, we got "23131131131"

Move 3(position 2->3):

cut the string "23131131131" -> "231" and "31131131"

the last character of left part of the string = "1"

past "31131131" for 1 times, we got "23131131131"

Move 4(position 3->4):

cut the string "23131131131" -> "2313" and "1131131"

the last character of left part of the string = "3"

past "1131131" for 3 times, we got "2313113113111311311131131"

Move 5(position 4->5):

cut the string "2313113113111311311131131" -> "23131" and "13113111311311131131"

the last character of left part of the string = "1"

past "13113111311311131131" for 1 times, we got "2313113113111311311131131"

 

The final string "2313113113111311311131131" has length 25.

The answer will be 25%(10^9+7) = 25

 

Input

First line contains one integer t(1 <= t <= 10) which means the number of testcases.

Each testcase contains two lines.

First line contains one integer x(1 <= x <= 10^6)

Second line contains a string. ( 1 <= length of the string <= 500)

Output

For each testcase, print only one positive number which means the length of the final string mod 10^9+7

Remember to print \n at the end of output.

Sample Input  Download

Sample Output  Download

Tags




Discuss




12823 - Nyan Cat Crisis   

Description

Previous episode: 12155

After the "blackhole" incident, scientists accidentally found the potential energy of blackholes that created by the collision of multiple cat-toasts: the energy productivity of cat-toast blackhole is far more larger than cat-toasts.

By observing the cat-toast blackhole near the event horizon, they found that the collided cat-toasts weren't teared into slices but spinning around the blackhole. The scientists decided to call it "Nyan Cat". The Nyan Cat blackhole soon be wildly spread to the whole world.

You have to login in order to see the image.

Nyan Cat spinning around the blackhole

Recently, the scientists found that if there are too many Nyan Cat spinning around one blackhole, the huge angular momentum will form an unstable energy field, which would cause the Nyan Cat blackhole system crash, then all the nearby substance will be inhaled.

They soon set up a team to deal with the potential threat. If a cat-toast blackhole contains too many Nyan Cat spinning around it, they'll use catnip(貓薄荷) to lure it out.

You are in a power plant, whose energy source is the cat-toast blackhole. The power plant engineer gives you the original cat-toast location before they collide into a blackhole. You need to figure out the number of blackholes that is safety, and the number of blackholes that contains too many Nyan Cat.


There are nodes on an 2D-plane. If the distance of two nodes are equal to or closer than , they are in the same group.

You are given a number . You have to find out:

  1. The number of groups with size less than .
  2. The number of groups with size equal to or greater than .
  • Note that the distance between two nodes and is:

    where and are the coordinate of the two nodes, respectively.

Input

The first line contains an integer , indicates the number of testcases.

In each testcase:

  • The first line contains , , and .
  • There are lines below. The -th line of the lines contains the coordinate of -th node: .

.

.

 

Output

Output two numbers:

The number of groups with size less than ,and the number of groups with size equal to or greater than , seperate with a space.

Remember to print a newline at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss