首页 > TAG信息列表 > BBQ

[AGC001E]BBQ Hard

做题时间:2022.8.11 \(【题目描述】\) 给定 \(N(1\leq N\leq 2\times 10^5)\) 个二元组,第 \(i\) 个二元组形如 \((a_i,b_i)(1\leq a_i,b_i\leq 2000)\) ,计算: \[\sum\limits_{i=1}^n\sum\limits_{j=i+1}^n \binom{a_i+a_j+b_i+b_j}{a_i+a_j}\mod 10^9+7 \]\(【输入格式】\) 第一行一

[AGC001E]BBQ Hard

BBQ Hard 题解 首先,我们可以考虑组合数是可以被表示成路径的形式的, ( n + m m

[AGC001E]BBQ Hard

题目 传送门 to AtCoder 思路 显然就是求 ∑ i < j

【AGC001E E - BBQ Hard】 题解

题目链接 题目 Snuke is having another barbeque party. This time, he will make one serving of Skewer Meal. He has a stock of N Skewer Meal Packs. The i-th Skewer Meal Pack contains one skewer, Ai​ pieces of beef and Bi​ pieces of green pepper. All skewers in

初学正则表达式

re.findall(’’,a) [0-9] 数字 \d [^0-9] 非数字 \D a[bc]d 中间是b或c a[^bc]d 中间不是b或c a[b-e]f 中间是b到e \w 提取中文,英文,数字,下划线 \W 提取特殊字符¥&空格\n\t \s 空格,换行符,制表符 \S非空白字符 [a-zA-Z]{3,5} 三到五个字母的单词 apple* 匹配e0次到无限次 apple

AT1983 [AGC001E] BBQ Hard

题面传送门 代数推导天地灭,组合意义保平安。 首先我们发现如果我们预处理组合数然后暴力计算是\(O(n^2)\)的很难优化。 我们考虑换一个思路。 我们知道\(C^{a_i+b_i}_{a_i}\)是从\((0,0)\)走到\((a_i,b_i)\)的方案数。 那么原题目要求的就是\((-A_i,-B_i)\)走到\((A_j,B_j)\)的方