规律杂记

geometry

  • You are given 2n points, you need to pair them to create n rectangles so that the intersection of all those rectangles forms a positive area. In how many ways you can do that?
  • answer: The intersection area of the rectangles is always the same if the area is positive. sort x i x_i xi a n d and and y i y_i yi , calculate the number of points below and up the ( x n , y n ) (x_n,y_n) (xn,yn) and ( x n + 1 , y n + 1 ) (x_{n+1},y_{n+1}) (xn+1,yn+1) points, and the answer is a ! ∗ b ! a!*b! a!b!

permutation

string

  • count the number of different S with the minimum number of distinct palindromic substring.
  • as the ∣ S ∣ |S| S range in [ 1 , 1 e 9 ] [1,1e9] [1,1e9] so we should find the minimum number in a small range ,and we can find that
   if(n == 1) printf("26\n");
   if(n == 2) printf("676\n");
   if(n == 3) printf("17576\n");
   else printf("15600\n");

你可能感兴趣的:(学习)