【JOISC2012】fish

Description

  There \ (n-\) fish, the \ (I \) fish length \ (L_i \) , a color \ (C_i \) ( \ (C_i \) only 'R', 'G', 'B').
  It can not exist at least two fish you need to pick out a fish, pick out the required fish \ (x, y \) satisfies \ (2L_x \ Le L_y \) .
  Seeking can pick \ (A \) Article redfish, \ (B \) Article green fish, \ (C \) strip of blue fish triplet \ ((a, b, c ) \) number.
  \ (n \ le 5 \ times 10 ^ 5 \)

Solution

  All fish Press \ (L \) in ascending order.
  Each fish enumeration \ (L \) of \ (L \) smallest fish, can find on the basis of picked \ (L \) largest fish \ (R & lt \) . The first set \ ([l, r] \ ) fish have \ (A \) Article redfish, \ (B \) Article green fish, \ (C \) article blue fish, the \ ((0,0, 0) \) to \ ((a, b, c ) \) all three points of the cube in space are to be selected. Problems seeking converted into (n-\) \ volume and cubes.
  We found \ (n \) cubes

Guess you like

Origin www.cnblogs.com/scx2015noip-as-php/p/11716704.html