Example 1: Input: secret = "1807", guess = "7810" Output: "1A3B" Explanation: 1 bull and 3 cows. The bull is 8, the cows are 0, 1 and 7. Example 2: In ...
分类:
其他好文 时间:
2020-02-12 22:25:22
阅读次数:
81
Farmer John owns Ncows with spots and N cows without spots. Having just completed a course in bovine genetics, he is convinced that the spots on his c ...
分类:
其他好文 时间:
2020-02-12 18:15:58
阅读次数:
70
这道题用树状数组做比较好,虽然树状数组能做的线段树也可以做到,但是树状数组更简洁方便,易操作 原理便是第x个数的二进制数最后一个“1”,决定tree的结点的长度 比如: sum[3]=tree[3]+tree[2]; sum[4]=tree[4]; sum[5]=tree[5]+tree[4]; 分 ...
分类:
其他好文 时间:
2020-02-12 13:15:00
阅读次数:
42
楼上的思路都是从一个石头找跳到另一个石头的路径,但其实这题可以对于上下左右四个方向分别做一个虚拟节点,然后只需要找虚拟节点左边的虚拟节点就行了 问题是:不会用set怎么办??? 其实可以发现用vector二分可以实现同样的操作(~~虽然长得不行而且还各种wa~~) vector存图的方法: 分别存下 ...
分类:
其他好文 时间:
2020-02-10 09:56:31
阅读次数:
64
[USACO17DEC]Standing Out from the Herd 题目描述 Just like humans, cows often appreciate feeling they are unique in some way. Since Farmer John's cows all ...
分类:
其他好文 时间:
2020-02-06 19:30:04
阅读次数:
81
Expedition Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30702 Accepted: 8457 Description A group of cows grabbed a truck and ventured on ...
分类:
其他好文 时间:
2020-02-05 18:42:25
阅读次数:
71
给你一棵 $n$ 个点的树,点带权,对于每个节点求出距离它不超过 $k$ 的所有节点权值和 $m_i$ 随便定一个根,设$f[i][j]$表示只考虑子树,距离为$j$的权值和,$g[i][j]$表示考虑子树和父树,距离为$j$的权值和,显然答案可以用$g$表示 $f[p][0]=w[p]$ $f[p ...
分类:
其他好文 时间:
2020-02-03 22:12:47
阅读次数:
68
The cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling- ...
分类:
其他好文 时间:
2020-02-02 19:42:09
阅读次数:
74
题目描述 Farmer John has M cows, conveniently labeled 1…M, who enjoy the occasional change of pace from eating grass. As a treat for the cows, Farmer John ...
分类:
其他好文 时间:
2020-02-02 11:58:53
阅读次数:
98
Bessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new ...
分类:
其他好文 时间:
2020-01-31 10:34:26
阅读次数:
62