Tc srm 548 div2

Source: Internet
Author: User

Reprint please indicate the source, thank you http://blog.csdn.net/ACM_cxlove? Viewmode = contents by --- cxlove

The opportunity to increase the rate is wasted again.

250pt: number of different numbers * the maximum number of a certain number. The variable name is wrong.

 
Class kingdomandducks {public: int minducks (vector <int> ducktypes) {int CNT [51], ANS = 0, TMP = 1; memset (CNT, 0, sizeof (CNT); For (INT I = 0; I <ducktypes. size (); I ++) if (CNT [ducktypes [I] = 0) {ans ++; CNT [ducktypes [I] ++ ;} else {CNT [ducktypes [I] ++; TMP = max (TMP, CNT [ducktypes [I]);} return ans * TMP ;}};

500pt: There is a Series. Each number can be added or subtracted from the number within X, so that the series turns into a strictly increasing series, with the smallest X.

Then, determine whether the answer is satisfied, traverse once, make each number as small as possible, and determine whether it is satisfied with a strict increase.

Class kingdomandtrees {public: int minlevel (vector <int> heights) {int low = 0, high = 1000000005, mid, H; while (low <= high) {mid = (low + high)/2; bool flag = true; For (INT I = 0; I  

1000pt? To be studied

Related Article

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.