69-64-79's blog

By 69-64-79, 14 years ago, In English
  1. A
    n*m/2.
  2. B
    Record the occurrences' number of each letters, signed as cnt[char].
    For each char in string, get the cnt[c]^2 plus together, and this is the answer.
  3. C
    Calculate the Convex Hull
    The sum of the max value between x-difference and y-difference of each adjacent points in the convex hull's set and 4 is the answer.
    4 step can make a circle of 360 degree.
  4. D
    Counting the answer with Half, and check the answer using Dynamic Programming.
    Let dp[i][j] means the probability of first i objects where j of them exploded, and the transfering formular is:
    dp[i][j] = P(i) * dp[i - 1][j - 1] + (1 - P(i)) * dp[i - 1][j], where P(i) means the i-th object exploding's probability.

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

By 69-64-79, 14 years ago, In English
  • Vote: I like it
  • -3
  • Vote: I do not like it