![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
01_容斥定理
KetchupZ
退役acmer一名,CCPC银+ICPC铜(欢迎大家访问我的Github地址:https://github.com/LieLieLiekey)
展开
-
容斥的几种写法
容斥的几种写法容斥公式本身就是 枚举出状态的组合,算其乘积,奇数个值为负,偶数个值为正原理:对于组合中每个状态有 在或不在两种,求其组合,可以用二进制枚举,也可以用递归二进制两层for循环递归#include<cstdio>#include<algorithm>#include<string>#incl原创 2018-12-12 21:34:09 · 293 阅读 · 0 评论 -
G - Visible Trees (数学,容斥定理)
G - Visible TreesThere are many trees forming a m * n grid, the grid starts from (1,1). Farmer Sherlock is standing at (0,0) point. He wonders how many trees he can see.If two trees and Sherlock are...原创 2018-12-05 18:49:00 · 156 阅读 · 0 评论 -
F - Co-prime(数学,容斥原理)
F - Co-primeGiven a number N, you are asked to count the number of integers between A and B inclusive which are relatively prime to N.Two integers are said to be co-prime or relatively prime if they...原创 2018-12-05 18:11:55 · 246 阅读 · 0 评论