[题解]CF559C C. Gerald and Giant Chess(容斥+格路问题) 55336399 Practice: Winlere 559C - 22 GNU C++11 Accepted 186 ms 1608 KB 2019-06-09 17:03:21 2019-06-09 17:03:21 一道小水题(为什么2400??我为什么之前被一道2200锤QAQ) 有个很显然的公式,在组合数学那本书上面也有. 从坐标\((0,0)\)到坐标\((x,y)\)总共有\({x+y}\c…
题意:给出一个棋盘为h*w,现在要从(1,1)到(h,w),其中有n个黑点不能走,问有多少种可能从左上到右下 (1 ≤ h, w ≤ 105, 1 ≤ n ≤ 2000),答案模10^9+7 思路:从(1,1)到(n,m)的方案数是c(n+m-2,n-1) 考虑不能走黑点 设dp[i]为从(1,1)走到(x[i],y[i]),中途没有走过任何一个黑点的方案数 dp[i]=dp[i]-dp[j]*c(x[i]+y[i]-x[j]-y[j],x[i]-x[j]) (x[j]<=x[i]且y[j]<…
题意 C. Gerald and Giant Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the…
C. Gerald and Giant Chess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/559/problem/C Description Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . The…
Gerald and Giant Chess Problem's Link: http://codeforces.com/contest/559/problem/C Mean: 一个n*m的网格,让你从左上角走到右下角,有一些点不能经过,问你有多少种方法. analyse: BZOJ上的原题. 首先把坏点和终点以x坐标为第一键值,y坐标为第二键值排序 . 令fi表示从原点不经过任何坏点走到第i个点的个数,那么有DP方程: fi=Cxixi+yi−∑(xj<=xi,yj<=yi)C(xi−xj)…
C. Gerald and Giant Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the ga…
Gerald and Giant Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the game…
E. Gerald and Giant Chess time limit per test 2 seconds memory limit per test 256 megabytes2015-09-09 input standard input output standard output Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say t…
C. Gerald and Giant Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Giant chess is quite common in Geraldion. We will not delve into the rules of the game, we'll just say that the ga…
传送门 令f[i]f[i]f[i]表示对于第iii个棋子,从(1,1)(1,1)(1,1)出发到它不经过其它棋子的方案数. 于是我们假设(h,w)(h,w)(h,w)有一个棋子,求出它的fff值就可以了. 然后考虑容斥转移fff数组. 根据定义,我们求出从(1,1)(1,1)(1,1)出发到它的总方案数,再减去经过了其它棋子的方案数. 然后再考虑如何才会补充不漏. 发现从之前每一个fff转移过来就行了. fi=(xi+yi−2xi−1)−∑fj∗(xi−yi+xj−yjxi−xj)f_i=\bi…