算法 二分图+最小独立集 思路 在日字形内两点连边(1),必处于不同色格子(0)。为二分图。要互不相扰,求最大独立集。 核心 最大匹配 bool dfs(int x, int y) { for (int i = 0; i < 8; i++) { int nx = x + dx[i], ny = y ...
原题点这里 bfs可以实现。这里注意的是,机器人从00出发,我们只要向右,向下走就可以了 public static int movingCount(int m, int n, int k) { int[] dx=new int[] {-1,1,0,0}; int[] dy = new int[]{ ...
分类:
其他好文 时间:
2020-04-08 21:00:42
阅读次数:
77
1 class Solution 2 { 3 int dx[4] = {1,0,-1,0}; 4 int dy[4] = {0,1,0,-1}; 5 public: 6 void setZeroes(vector<vector<int>>& matrix) 7 { 8 int m = matrix. ...
分类:
其他好文 时间:
2020-03-30 19:52:56
阅读次数:
54
#include<iostream> #include<algorithm> #include<string> #include<cstring> #include<queue> using namespace std; int dx[]={0,0,1,-1}; int dy[]={1,-1,0,0 ...
分类:
其他好文 时间:
2020-03-29 12:46:37
阅读次数:
134
"Link" 如果$l=r$那么我们给它加个特判。(虽然数据里没有) 先写出答案的表达式: $$ \frac{\int_{l_1}^{r_1}\cdots\int_{l_n}^{r_n}|\sum\limits_{i=1}^nx_i|\mathrm dx_n\cdots\mathrm dx_1}{\ ...
分类:
其他好文 时间:
2020-03-17 00:04:11
阅读次数:
79
1、定义一个点类Point,包含2个成员变量x、y分别表示x和y坐标,2 个构造器Point()和Point(int x0,y0),以及一个movePoint(int dx,int dy)方法实现点的位置移动,创建两个Point对象p1、p2,分 别调用movePoint方法后,打印p1和p2的坐标 ...
分类:
其他好文 时间:
2020-03-06 23:34:11
阅读次数:
96
994. 腐烂的橘子 解法一:DFS 1 int dx[4]={-1,0,1,0}; 2 int dy[4]={0,-1,0,1}; 3 class Solution { 4 public: 5 //这里需要对普通的DFS进行一定的处理,即DFS进化版本。。。 6 void dfs(vector<v ...
分类:
其他好文 时间:
2020-03-05 01:21:16
阅读次数:
67
1.3 齐次方程 $n$ 次齐次函数: $f(x,y)$ 如:$x^2 3xy$ 为二次齐次函数,$x^3 3x^2y+y^3$ 为三次齐次函数。 齐次微分方程:$M(x,y)dx+N(x,y)dy=0$ 其中,$M(x,y)\,N(x,y)$ 是同次齐次函数。 例:$\frac{dy}{dx}=\ ...
分类:
其他好文 时间:
2020-02-27 13:23:58
阅读次数:
85
https://www.acwing.com/problem/content/1326/ 思路: 枚举起点 正反方向 如果满足.输出 #include <bits/stdc++.h> using namespace std; int n; int g[16][16]; int dx[4] = {-1 ...
分类:
其他好文 时间:
2020-02-24 20:22:44
阅读次数:
94
X86和X87汇编指令 数据传输指令 它们在存贮器和寄存器、寄存器和输入输出端口之间传送数据. 通用数据传送指令. 输入输出端口传送指令. IN I/O端口输入. ( 语法: IN 累加器, {端口号│DX} ) OUT I/O端口输出. ( 语法: OUT {端口号│DX},累加器 )输入输出端口 ...
分类:
其他好文 时间:
2020-02-13 12:33:26
阅读次数:
67