2407 - I2P(I)2021_Hu_lab4-A Scoreboard

Time

2021/11/08 20:30:00 2021/11/08 20:31:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
13268 A perfect bed for Domo
13297 Learning Matrix

13268 - A perfect bed for Domo   

Description

Domo is a brilliant dog. When he finds a perfect bed for him, he will fall asleep immediately.

 

A subarray (a sequence of consecutive elements in an array) is a perfect bed for Domo if it satisfies the following two conditions.

 

1. the length of this subarray is L.

2. The numbers in the middle are greater than the numbers on both sides the left most and the right most of the subarray. In other words, ai < aj for all pairs of i and j (i ∈ {0, L-1}, 0 < j < L-1)

 

For example, a subarray [3, 5, 5, 3] is a perfect bed of length 4 for Domo, but [4, 5, 3, 2] isn't (since a[2] < a[0]).

 

Given an array and an integer L, your task is to find the perfect bed for Domo. If there are multiple perfect beds for Domo, print them all in order by the index of the first element of the subarray.

 

Check the sample input/output for more details, but be careful not to wake Domo up. He will let you get zero points on this question if he wakes up accidentally.

 

Input

The first line contains two integers N and L (3 ≤ N ≤ 1000, 3 ≤ L ≤ 10) - the length of the given array and the length of the subarray, respectively.

The second line contains N integers a0, a1, ..., an-1 (0 ≤ ai ≤ 1000)

 

Output

The subarray of which describes the perfect bed for Domo.

If there are multiple perfect beds, print them all one per line.

 

If there is no perfect bed for Domo, print "Domo".

 

Note that you should print a newline character at the end of each line.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




13297 - Learning Matrix   

Description

"We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy

I just wanna tell you how I'm feeling
Gotta make you understand
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
"

~ 《Never Gonna Give You Up》

 

In this problem, given 2 matrix, A[N, M] and B[M, N]. You are asked to calculate C = (A x B)(the transpoed matrix of A multiplies B).

 

How to calculate A x B:

How to transpose a matrix:

 

Note that every elements in A, B, and C can be represented by datatype int.

Input

There are three parts of the input:

(1)1<=N<=2100

(2)1<=M<=2100

(3)A[N,M] and B[M,N] separated by a newline charcter. -100<=The values in the matrix<=100.

Output

C = (A x B)(the transpoed matrix of A multiplies B).

Note that you have to print whitespaces between each elements and a newline character in the end of each rows.

Sample Input  Download

Sample Output  Download

Tags




Discuss