
其他
After0514
这个作者很懒,什么都没留下…
展开
-
Codeforces 421D
假如选择二元组(a,b)那么怎么计算有多少人同意哪?容斥一次就好了 用同意a的人数+同意b的人数-同时同意(a,b)的人数 然后对于这题,所有的二元组分为两种情况 1.存在同时同意二元组里面的两个 2.不存在 即 同时同意(a,b)的人数=0原创 2017-01-02 21:34:10 · 367 阅读 · 0 评论 -
Codeforces 117D
不停的分治下去就好了, 更容易想到的是 求出(1,r,u,v)-(1,l-1,u,v)#include <cstdio>typedef long long LL;int Mod;LL u,v;int calc(LL a,LL d,LL n,LL l,LL r){ if (v<a || u>a+d*(n-1)) return 0; if (l==1 && r==n){原创 2016-12-24 15:42:31 · 3718 阅读 · 0 评论 -
Codeforces 30D
题意从第k个点出发遍历所有的n+1个点,可以再任一点结束,的最短路#include <cmath>#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#define N 100100using namespace std;int n,k;double newtag;double xx[N原创 2016-12-24 12:12:45 · 306 阅读 · 0 评论 -
Codeforces 68C
题意:给定6个点的有上下界的网络求最大费用最小流 复杂度不可控#include<cstdio>int n,ans,l[10][10],r[10][10],f[10],c[10][10];// Last Change: 2011-03-29 11:15:29void dfs(int s,int t,int fl,int cost原创 2016-12-24 11:26:36 · 399 阅读 · 0 评论 -
Codeforces 359E
题意:从一个点出发,可以上下左右移动,移动的前提是,方向上至少有一个灯是亮的,每次到达一个位置,可以把灯点亮或者关掉,输出一组解能把所有的等都关掉,并且回到起点。 直接搜索一遍就好了,#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <queue>using namespa原创 2016-12-24 10:46:28 · 221 阅读 · 0 评论 -
Codeforces 140F
对点排序后,总共有k次魔法可以使用 枚举最左边没有用魔法直接在给定点中找到对称点的 枚举最右边没有用魔法直接在给定点中找到对称点的 枚举量分别不会超过k, 然后他们两个一定是互相匹配的,#include<cstdio>#include<set>#include<algorithm>using namespace std;#define X first#define Y se原创 2016-12-23 21:34:43 · 302 阅读 · 0 评论 -
Codeforces 491B
|x1−x2|+|y1−y2|=max((x1+y1)+(−x2−y2),(x1−y1)+(−x2+y2),(−x1+y1)+(+x2−y2),(x1−y1)+(+x2+y2))\begin{equation}|x_1-x_2|+|y_1-y_2|=\\max((x_1+y_1)+(-x_2-y_2) ,(x_1-y_1)+(-x_2+y_2) ,(-x_1+y_1)+(+x_2-y_2)原创 2016-12-23 15:59:29 · 300 阅读 · 0 评论 -
Codeforces 177E2
答案一定是连续的 所以二分得到上下界就好了#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>#define N 220000typedef __int64 LL;using namespace std;LL l,r,mid,ans;int n,c,a[N],b[N],i;LL check(LL原创 2016-12-23 15:29:45 · 222 阅读 · 0 评论 -
Codeforces 154D
分类讨论 if 可以一步杀死 else if如果a<=0 肯定是draw else 只能不断靠近 1.错过了 draw 2.一定有一个死#include<cstdio>#include<iostream>#include<cstring>using namespace std;const int N=1e5+10;int aa[N],bb[N],id[N];int vis[N原创 2016-12-23 15:02:51 · 460 阅读 · 0 评论 -
欢迎使用优快云-markdown编辑器
⎧⎩⎨⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪⎪I˙AI˙BI˙C=I˙aKV=IafKVe−j30∘=I˙bKV=IbfKVe−j90∘=−(I˙A+I˙B)\begin{equation*}\left\{\begin{aligned}\dot{I}_A &= \frac{\dot{I}_a}{K_V}=\frac{I_{af}}{K_V}e{-j30^{\circ}} \\\dot{I}_B &=\f原创 2017-06-03 11:38:44 · 256 阅读 · 0 评论