摘要: 很方便,两两相邻原点向量求差积,处以二即是面积。 #include<iostream> #include<cstring> #include<algorithm> #include<string> #include<cmath> #include<queue> #include<cstdio> us 阅读全文
posted @ 2021-01-02 18:01 TheDa 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 母函数可以编程解析,这样就能够很方便求出 正整数拆分问题了。 貌似还有递推公式 f(n, m) = 1; ( n = 1 or m = 1 ) f(n, n); ( n < m ) 1+ f(n, m - 1); ( n = m ) f(n - m, m) + f(n, m - 1); ( n > 阅读全文
posted @ 2021-01-02 16:56 TheDa 阅读(74) 评论(0) 推荐(0) 编辑
摘要: void bfs(int sx,int sy) { queue<node>q; vis[sx][sy]=true; q.push(node{sx,sy}); while(!q.empty()) { node pre=q.front(); q.pop(); for(int i=0;i<8;i++) { 阅读全文
posted @ 2021-01-02 16:34 TheDa 阅读(63) 评论(0) 推荐(0) 编辑