[Spoj Tsum] Triple sums (fft+ generation function + tolerance principle) __ Traditional questions

Source: Internet
Author: User
Topic link

http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=23842 Topic

Given n n number a1,a2,a3...an A_1,a_2,a_3...a_n, for all existing S S, the sum of three numbers of S S is Ai,aj,ak A_i,a_j,a_k ordered pair (i,j,k) (i,j,k) (i<j<k) ( Number of I. train of Thought

If the question does not limit three numbers to be different, it is very simple, with a polynomial a (x) a (x), where the coefficient of Xi X^i is the number of numbers I, a (x) 3 A (x) ^3 each Xsk X^{s_k} is the same number as the three for Sk S_k.
But now add three numbers with different restrictions, consider fixing three numbers and S S, at this time and for S s of the three different numbers of the composition of the number = all the random three numbers (unrestricted) composition and for s s of ordered pairs of numbers-two numbers of the same composition and for S s of the number of ordered pairs + The three numbers are the same and the number of ordered pairs of s S, which is a very obvious principle of tolerance and repulsion.

Expressed in a generative function (the following Sigma section omits the coefficients preceding these XI x^i)
All the random three numbers (unrestricted) of an ordered pair consisting of an answer polynomial =a (x) 3=∑x+3∑xy−6∑

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.