Descriprion 给出$n\times m$ 的方格,有些格子不能铺线,其它格子必须铺,形成一个闭合回路。问有多少种铺法? Solution 使用括号表示法记录状态,记1为 '(' ,2为 ')' ,0为无插头,分8种情况讨论: 1:当前格子有障碍,此时必须下插头和右插头为0,转移后状态不变 ...
分类:
其他好文 时间:
2020-07-29 17:30:42
阅读次数:
68
--每次删多少 DECLARE @BatchSize INT = 100 WHILE 1 = 1 BEGIN DELETE TOP (@BatchSize) FROM tb WHERE id>30 IF @@ROWCOUNT < @BatchSize BREAK END ...
分类:
数据库 时间:
2020-07-29 15:33:08
阅读次数:
69
AcWing 829. 模拟队列 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int q[N],hh,tt; void init(){ hh=0; tt=-1; } void add(int x){ q[++tt ...
Leetcode.27 | Remove Element(Python) Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do no ...
分类:
编程语言 时间:
2020-07-29 14:58:26
阅读次数:
82
Docker-Compose 介绍 有时候运行一个镜像需要大量的参数,可以通过Docker-Compose编写这些参数.而且Docker-Compose可以版主我们批量管理容器,这些信息值需要通过一个docker-compose.yml文件去维护即可 下载并安装Docker-Compose 下载Do ...
分类:
其他好文 时间:
2020-07-29 14:47:52
阅读次数:
69
Task Scheduler (M) 题目 You are given a char array representing tasks CPU need to do. It contains capital letters A to Z where each letter represents a ...
分类:
其他好文 时间:
2020-07-29 10:27:27
阅读次数:
69
##输出1到n以内所有的二进制回文数 #include <stdio.h> #define SIZE 50 typedef enum bool Bool; enum bool { false, true }; int main() { int n, i, j; Bool flag = false; ...
分类:
其他好文 时间:
2020-07-29 10:02:00
阅读次数:
84
题意:给一个长度为$n$的序列$a_i$和一个数$k$。 现在把$a$序列重复$k$次生成一个数列$b$,然后从第一位开始往一个栈中加入$b_i$ 。 如果这个栈里存在元素与$b_i$相等那么一直pop直到把那个数弹掉然后不加入新数;否则push$b_i$入栈。求全部操作完之后栈中的元素。 $n \ ...
分类:
其他好文 时间:
2020-07-29 09:56:37
阅读次数:
60
如果不需要确定当前遍历到了哪一层,BFS模板如下。 while queue 不空: cur = queue.pop() for 节点 in cur的所有相邻节点: if 该节点有效且未访问过: queue.push(该节点) 如果要确定当前遍历到了哪一层,BFS模板如下。 这里增加了level表示当 ...
分类:
其他好文 时间:
2020-07-28 22:38:05
阅读次数:
77
题面 #include <bits/stdc++.h> using namespace std; template<typename temp> void read(temp &x){ x = 0; temp f = 1; char ch; while(!isdigit(ch = getchar() ...
分类:
其他好文 时间:
2020-07-28 22:35:46
阅读次数:
61