Problem Description
FSF is addicted to a stupid tower defense game. The goal of tower defense games is to try to stop enemies from crossing a map by building traps to slow them down and towers which...
分类:
其他好文 时间:
2014-08-13 13:14:47
阅读次数:
196
最开始的时候思路就想错了,就不说错误的思路了。因为这n个数的总和是一定的,所以在取数的时候不是让自己尽可能拿的最多,而是让对方尽量取得最少。记忆化搜索:d(i, j)表示原序列中第i个元素到第j个元素构成的子序列,先手取数能够得到的最大值。sum(i, j) 表示从第i个元素到第j个元素的和因为要让...
分类:
其他好文 时间:
2014-08-13 12:47:56
阅读次数:
247
题目:hdu4944FSF’s game(数论)
题目大意:给定N,然后会有N * ( N + 1)/2个等级的矩形,(1 * 1, 2 * 1, 2* 2, ...N * 1, N * 2.. N* N).将这些矩阵分成大小相同的K * K 的正方形,能够获得金币A * B / gcd(A
/ K, B/ K);然后给定N,问能够得到的总金币。
解题思路:对于sum(N):...
分类:
其他好文 时间:
2014-08-13 10:31:50
阅读次数:
262
Problem StatementThe Happy Letter game is played as follows: At the beginning, several players enter the field. Each player has a lowercase English le...
分类:
移动开发 时间:
2014-08-13 03:33:35
阅读次数:
201
Description
In the two-player game "Two Ends", an even number of cards is laid out in a row. On each card, face up, is written a positive integer. Players take turns removing a card from either end...
分类:
其他好文 时间:
2014-08-13 01:18:05
阅读次数:
209
#include
#include
typedef unsigned long long ll;
const ll MOD = (1ULL<<32);
const int N = 500001;
int t, n;
ll ans[N], frc[N];
void init() {
for (ll i = 1; i < N; i++) {
for (ll j = i; j < ...
分类:
其他好文 时间:
2014-08-13 01:14:05
阅读次数:
218
# CGI HTTP server
## Getting Started
Python 2.x is preferred to this simple demo. I'm using Python 2.7 over windows.
* https://docs.python.org/2.7/library/cgihttpserver.html
* https://do...
分类:
编程语言 时间:
2014-08-13 01:09:54
阅读次数:
222
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:
其他好文 时间:
2014-08-13 00:28:34
阅读次数:
324
题目链接:hdu 4944 FSF’s game
题目大意:给定N,可以用不大于N的长a和宽b,组成N?(N?1)2种不同的矩形,对于每个矩形a?b要计算它的值,K为矩形a,b可以拆分成若干个K?K的正方形。∑a?bgcd(a/k,b/k),输出所有矩形值的和。
解题思路:假设有边a和b,那么k肯定即使a的因子也是b的因子。定义f(n)为矩形最长边等于n的情况下所有矩形值的和。那么f(...
分类:
其他好文 时间:
2014-08-12 22:17:44
阅读次数:
322
题目链接
题意:给定一个整数n,求∑f(i, j)(1
思路:依题意,我们可以得到一个递推式ans[n] = ans[n - 1] + ∑f(n, j)(1
对于∑f(n, j)而言,我们用aj(1 <= j <= n)表示gcd(n/k, j/k)所能取到的值的集合,那么可以得到∑f(n, j) = (n * 1 / a1 + n * 2 / a2 + ... + ...
分类:
其他好文 时间:
2014-08-12 22:07:34
阅读次数:
218