简单$\text{dp}$ 我们设$\text{dp[i][j]}$表示前$\text{i}$位除以$\text{3}$的余数为$\text{j}$的个数,那么可以明显的推出状态转移方程 $\text{dp[i][0]=dp[i 1][1] mod[2]+dp[i 1][2] mod[1]+dp[i ...
分类:
其他好文 时间:
2019-02-10 23:06:52
阅读次数:
211
Farmer John has received a noise complaint from his neighbor, Farmer Bob, stating that his cows are making too much noise. FJ's N cows (1 <= N <= 10,0 ...
分类:
其他好文 时间:
2019-02-09 16:28:48
阅读次数:
192
C. Ayoub and Lost Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Ayoub and Lost ...
分类:
其他好文 时间:
2019-02-09 12:08:55
阅读次数:
176
一道思维题 不仅是和这道题在战斗,我和编译器也进行了一场激烈的角逐 因为编译器出了点小问题... 对于dev或者codeblocks 我的方法是卸载了重新装/重启电脑 但是对于vscode 我的方法是, 对着它掉眼泪,看它能不能可怜可怜我,赶紧恢复到正常状态.... cpp include usin ...
分类:
其他好文 时间:
2019-02-06 15:59:13
阅读次数:
173
Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wak ...
分类:
编程语言 时间:
2019-02-05 22:33:22
阅读次数:
173
Cow Contest 题目链接:http://poj.org/problem?id=3660 Description: N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming cont ...
分类:
其他好文 时间:
2019-02-04 20:50:06
阅读次数:
186
Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID ...
分类:
其他好文 时间:
2019-02-03 18:07:12
阅读次数:
139
P3052 [USACO12MAR]摩天大楼里的奶牛Cows in a Skyscraper 给出n个物品,体积为w[i],现把其分成若干组,要求每组总体积 eps; T = delta) { // 模拟退火打乱序列过程 ll x = rand() % n + 1, y = rand() % n + ...
分类:
其他好文 时间:
2019-02-02 23:07:00
阅读次数:
210
题目大意: 一个长度为$n$的数组,其和能被$3$整除,且每一个数字满足$a_{i}\in [l,r]$,问有多少种可以满足上述三个条件的数组 分析: $dp$。$dp[i][j]=$前$i$个数构成余数为$j$的方案数,然后通过这个$dp$的定义,可以推出递推方程$dp[i][j]=\sum_{i ...
分类:
其他好文 时间:
2019-01-31 20:53:55
阅读次数:
150
Description Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standin ...
分类:
其他好文 时间:
2019-01-28 14:06:25
阅读次数:
135