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