链接:传送门 题意:给出3 × 3的方块,其中任意2 × 2的方块和左上角2 × 2的和相等,还给出9个格子中的4个--a,b,c,d ,在1~n中选择一些数(可重复)填入剩下5个格子中,问有多少种填法 思路:设5个 ?分别为x1,x2,x3,x4,x5 ,最后合并整理可以求得两个式子: x4 - x2 = a - b + c - d x5 - x1 = a + b - c - d 先遍历x4 然后二分 x2 ,O(2nlog(n))的复杂度,理论上是没问题的 /****************…