Description
The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points eq...
分类:
其他好文 时间:
2014-08-05 11:12:25
阅读次数:
267
今天听了老师讲的最长公共子序列,就拿以前做过的题又做了一遍。。。
我用的是最简单普通的方法,
代码:
#include
#include
#include
using namespace std;
int dp[1005][1005];
int main()
{
char a[1005], b[1005];
int t;
scanf("%d", &t);
while(t --){
...
分类:
其他好文 时间:
2014-08-04 17:59:47
阅读次数:
186
Description
N children are sitting in a circle to play a game.
The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The ...
分类:
其他好文 时间:
2014-08-04 17:57:27
阅读次数:
284
Throwing cards away I
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu
Submit
Status
Description
Given is an ordered deck of n cards numbered 1 to n with card 1 at the t...
分类:
其他好文 时间:
2014-08-04 17:38:47
阅读次数:
272
Description
N children are sitting in a circle to play a game.
The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. Th...
分类:
其他好文 时间:
2014-08-02 15:37:33
阅读次数:
259
分析:
首先这道题不能当做普通的01背包问题,因为W 我们知道价值v小的很,最大100, 那我们就可以利用这一点,拿价值 之和作为原来的质量之和, 但是有一点要注意:因为题意是要在质量不超过W的范围内,找出最大的价值,我们现在是以最大的价值求质量,那么仔细分析一下,我们就能想明白,要以某价值i的背包存放尽量小的质量,这样反过来分析一下就可以知道,较小的质量有个较大的价值序号,这样完全满足题意了,...
分类:
其他好文 时间:
2014-08-02 13:01:23
阅读次数:
168
括号匹配(二)
时间限制:1000 ms | 内存限制:65535 KB
难度:6
描述给你一个字符串,里面只包含"(",")","[","]"四种符号,请问你需要至少添加多少个括号才能使这些括号匹配起来。
如:
[]是匹配的
([])[]是匹配的
((]是不匹配的
([)]是不匹配的
输入第一行输入一个正整数N,表示测试数据组数(N
每组测试数...
分类:
其他好文 时间:
2014-08-02 10:06:33
阅读次数:
169
SD总线通信是基于指令和数据比特流,起始位开始和停止位结束。SD总线通信有三个元素:1.Command:由host发送到卡设备,使用CMD线发送;2.Response:从card端发送到host端,作为对前一个CMD的相应,通过CMD线发送;3.Data:即能从host传输到card,也能从card传输到host,通过data线传输。一、Commands 以下是四种用于控制卡设备的指令类型,每个c...
分类:
其他好文 时间:
2014-08-01 19:46:42
阅读次数:
219
Greedy, Greedy, Greedy.. It is all about maximum interval update.One trick is, we start looping over each element from the one nearest to end to farth...
分类:
其他好文 时间:
2014-08-01 13:32:21
阅读次数:
283
快速幂取模算法的时间复杂度为O(logb),能在几乎所有的程序设计(竞赛)过程中通过,是目前最常用的算法之一,值得推广学习!!!
首先要了解这样一个公式:a^b mod c=(a mod c)^b mod c(详细证明请看数论或者离散数学)
了解了这个公式,我们可以先让a关于c取余,这样可以大大减少a的大小, 于是不用思考的进行了改进,代码如下: ..........
分类:
其他好文 时间:
2014-08-01 00:09:31
阅读次数:
299