Uoj Thinking Topics

Source: Internet
Author: User
Tags first row

Topic Link: Click to open the link

#279. "UTR #2" topic AC Channel Statistics description Submit a custom test

The difficulty was set, and the ambitious Jimmy Ben began to look for the wisdom of the inhabitants of God's planet.

However, Jimmy did not anticipate that the residents of God's Ben Planet told Jimmy more: "This year God Ben Planet economic downturn, we all want to stay at home, which has the mind out of the question." ”

To save the situation, Jimmy has decided to build a high-speed transmission channel for God's Ben Planet to promote communication between the different regions of the planet.

The Ben Planet has an nn-block town. For any two small town v,uv,u (V≠uv≠u), Jimmy asked to establish a transmission time of W (V,u) W (v,u) in the v,uv,u between a non-transmitting channel, where W (v,u) W (v,u) is not more than KK non-negative integer. Upon completion, the inhabitants of God's Ben Planet May depart from a small city and pass through one or several transmission passages to another town to communicate with each other, and spend time on the transmission time of all passing channels.

The question of Jimmy has not decided the transfer time of each transmission channel value, but for any two small city v,uv,u, decided to arrive from the VV to uu the shortest time to be equal to D (v,u) d (v,u). But Jimmy more question masterful, so he found you-wind glass do not Gewitsch, please help Jimmy more question how many different ways to meet the conditions of the transmission channel construction plan it.

Because the number of scenarios can be large, you only use the output scheme number to 998244353998244353 (7x17x223+17x17x223+1, a prime) after the result of modulo. input

The first row of two integers n,kn,k. Guaranteed n≥1,k≥0n≥1,k≥0.

Next nn line, each line has a non-negative integer NN, the first

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.