Counting

菜鸟记录:c语言实现PAT甲级1004--Counting Leaves

好消息:与上题的Emergency是同样的方法。坏消息:又错了&&c++真的比c方便太多太多。 A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members ......
甲级 Counting 语言 Leaves 1004

CF1816F Xor Counting - dp - 分治 -

题目链接:https://codeforces.com/contest/1816/problem/F 题解: 一道有趣的题。 首先发现 $m=1$ 和 $m\geq 3$ 时结论是平凡的。$m=1$ 时结论显然,下面讨论一下 $m\geq 3$ 时: 首先可以构造 $[x, (n-x)/2, (n- ......
Counting 1816F 1816 Xor CF

Counting Arrays CF893E

给出x和y,求一个长度为y的序列,其乘积为x,允许有负数,求这种序列的个数, x分解质因数,考虑每个 p^e, 把e分为y 份( 可以为0),个数为 C( e+y-1,e) 这题需要乘法逆元 来进行乘法 #include <iostream> #include <cstring> #include ......
Counting Arrays 893E 893 CF

[AtCoder] B - Counting Grids

The key observation is that there is always at most 1 cell that violates both conditions. Proof: if x violates both conditions, that means all other n ......
Counting AtCoder Grids