题意: "题目链接" 给一个$n$边形(凸多边形),再给出$m$个点,求有多少个点落在多边形内部(含边界),点的坐标均为整数$n,m using namespace std; const int N=1e5+5; int n,m,k,pos,mn=1e9,ans; struct point{long ...
分类:
其他好文 时间:
2020-01-22 10:40:19
阅读次数:
77
嘛,你把图分类一下 分成横坐标+纵坐标为奇偶... 然后在图上跑一个二分图最大权匹配 然后就是max(ans, 全部的-ans) 我代码写得有点... 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int inf=9999999; 5 in ...
分类:
其他好文 时间:
2020-01-22 10:32:36
阅读次数:
54
#include<bits/stdc++.h> using namespace std; int m,n,tot=-1,h[1005],ans=0,tp=0; struct node{ int from,next,to,rest; int last; }e[10005]; void add(int ...
分类:
其他好文 时间:
2020-01-22 01:18:06
阅读次数:
102
过水不解释 #include<bits/stdc++.h> using namespace std; long long tot=-1,sum=0,h[1005],flow[1005],g[1005],ans=0,dis[1005],ans2=0,inf=999999; bool vis[1005] ...
分类:
其他好文 时间:
2020-01-22 01:05:18
阅读次数:
78
直接拆点做,但就是搞不懂为什么wa掉了第一小问.... 不管了 #include<bits/stdc++.h> using namespace std; long long tot=-1,sum=0,h[20005],flow[20005],g[20005],ans=0,dis[20005],ans ...
分类:
其他好文 时间:
2020-01-22 01:05:02
阅读次数:
90
原文链接:传送 1 #include"algorithm" 2 #include"iostream" 3 #include"cmath" 4 using namespace std; 5 long long x,y,z,ans; 6 int main(){ 7 while(cin>>x>>y>>z) ...
分类:
其他好文 时间:
2020-01-21 17:58:14
阅读次数:
45
题目链接: "CF817C" 前置算法 : 二分 我们先考虑如何得到答案,若最小满足$x$减去其各数位之和后大于$s$ $ans = n x + 1$ 我们只要打个表就可以发现$:$ 若$x define ull unsigned long long using namespace std; ull ...
分类:
其他好文 时间:
2020-01-21 13:26:02
阅读次数:
57
```cpp #include #include #include #include using namespace std; setp[27]; int b[9],vis[9],ans[9],s[9],n=0,small=10,cha; //n::iterator it=p[s[cur]].beg... ...
分类:
其他好文 时间:
2020-01-21 10:44:55
阅读次数:
73
题目 "传送门" 思路 首先我们解决第一个问题 怎么使值最大? 这个可以通过公式变形来解决 $ans=\sum_{i=1}^{n}(dep_i+dep_{p_i} 2 dep_{lca_{i,p_i}})=2 \sum_{i=1}^{n}dep_i 2 \sum_{i=1}^{n}dep_{lca_ ...
分类:
其他好文 时间:
2020-01-20 22:32:21
阅读次数:
57
这看题目一眼容斥,令聊唱、跳、rap和篮球的组数 至少 有$x$的方案数为$g(x)$ 那么显然$Ans=\sum_{i=0}^{\min(\lfloor \frac{n}{4}\rfloor,a,b,c,d)} ( 1)^ig(i)$,考虑如何计算$g(x)$ 先考虑放下给定的$x$组,显然它们的 ...
分类:
其他好文 时间:
2020-01-20 12:57:36
阅读次数:
60