2405 - I2P(I)2021_Yang_hw5 Scoreboard

Time

2021/10/26 21:00:00 2021/11/02 18:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12898 Enola
13290 Matching Strings
13308 How much is the string worth

12898 - Enola   

Description

Enola's mom leaves Enola a secrete encrypted message! The message seems to be a nonsense combination of lower case alphabets. However, clever Enola soon finds out that the message can be decrypted into a meaningful vocabulary by rearranging the positions of the alphabets. Enola comes up with a vocabulary, can you tell her whether the message can be decrypted into her vocabulary?

Input

The input consists of multiple test case, terminated with EOF (end of file).

On the first line of the test case are two integers n and m, being the length of the encrypted message and the length of a vocabulary.

On the next line are two strings a and b, being the encrypted message and a vocabulary.

  • 1 <= n, m <= 1000

  • a, b only contains lower case alphabets (i.e. a-z).

Output

For each test case, if a can be decrypted into b by rearranging the positions of alphabets, print "YES" in one line, otherwise print "NO".

Sample Input  Download

Sample Output  Download

Tags




Discuss




13290 - Matching Strings   

Description

Given a set of strings S1 and some query strings S2. For each strings in S2, you need to determine whether it exists in set S1 or not.

Input

First line contains 2 integers n and m, which is the size of S1 and S2. (0 < n,m <= 100) 

Next, there're n lines, each representing a string in S1.

Last, m lines are provided, each representing a string in S2.  

The length of strings is not greater than 10^3.

Output

Print m lines. Each line contains "Yes" or "No", which means whether the i-th string in S2 exists in S1 or not.

Print '\n' in the last line.

Sample Input  Download

Sample Output  Download

Tags




Discuss




13308 - How much is the string worth   

Description

In this problem, we define a worth 1 coin, b worth 2 coins, c worth 3 coins ...., z worth 26 coins, other charactor worth 0 coin.
Now we have some lines of string S (may contain spaces), you need to write a program to calculate how much each line is worth until S0.

Hint:
0_ and _0 ( _ = space) worth 0, not the end of input

Input

The input contains several lines, each line contains a string (may contain space)

testcases:

0 <=  |S| <= 100

Output

Output the value of each line of string until S = 0.

Sample Input  Download

Sample Output  Download

Tags




Discuss