http://acm.hdu.edu.cn/showproblem.php?pid=3038 
1 #include 2 #include 3 #include 4 #define maxn 600000 5 using namespace std; 6 
7 int f[maxn],d[max...
                            
                            
                                分类:
其他好文   时间:
2014-05-19 18:51:33   
                                阅读次数:
252
                             
                    
                        
                            
                            
                                XAlign是一个 Xcode 的实用插件,用于对齐规范代码。1. 按首个 = 对齐2. 
按宏定义群组对齐3. 按属性群组对齐1.自动安装$ curl github.so/XAlign/build/install.sh | sh
                            
                            
                                分类:
其他好文   时间:
2014-05-19 18:40:32   
                                阅读次数:
414
                             
                    
                        
                            
                            
                                题目链接:hdu 4803 Poor Warehouse Keeper
题目大意:有以个屏幕可以显示两个值,一个是数量x,一个是总价y。有两种操作,一种是加一次总价,变成x,x+y;一种是加一个数量,这要的话总价也会相应加上一个的价钱,变成x+1,y+y/x。总价显示的为取整后的整数,小数部分忽略。给定一个目标x,y,初始状态为1,1,求最少需要多少次可以目标状态,不可以达到的话输出-1....
                            
                            
                                分类:
其他好文   时间:
2014-05-18 18:46:36   
                                阅读次数:
276
                             
                    
                        
                            
                            
                                题目:http://acm.hdu.edu.cn/showproblem.php?pid=4542
小明系列故事——未知剩余系
Time Limit: 500/200 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 889    Accepted Submission...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 18:43:04   
                                阅读次数:
402
                             
                    
                        
                            
                            
                                http://acm.hdu.edu.cn/showproblem.php?pid=2066
求多源多汇的最短路,n最大为1000,floyd三重循环会超时。继续dijkstra吧。
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define LL long long
#...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 18:26:39   
                                阅读次数:
238
                             
                    
                        
                            
                            
                                题目:
    链接:点击打开链接
算法:
    完全背包。
    状态转移方程:    dp[j]  +=  dp[j-i];dp[j]表示钱j可以兑换的方法,,,,,i是硬币的价值1,2,3,,,个数是不限的
代码:
#include
#include
#include
using namespace std;
int dp[40000];
int n;
int main(...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 15:43:08   
                                阅读次数:
265
                             
                    
                        
                            
                            
                                Problem Description
For a decimal number x with n digits (AnAn-1An-2 ... A2A1), we define its weight as F(x) = An * 2n-1 + An-1 * 2n-2 + ... + A2 * 2 + A1 *
 1. Now you are given two numbers A and...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 06:35:50   
                                阅读次数:
300
                             
                    
                        
                            
                            
                                题目:
    链接:点击打开链接
题意:
    知道存钱罐的质量和装满硬币的存钱罐的质量,然后是不同硬币的价值和质量,求出存钱罐里钱币的最小价值。
算法:
    完全背包问题,银币的个数是不限的。
思路:
    状态转移方程:j = 0时,价值为0
dp[j] = min(dp[j],dp[j-w[i]]+v[i]);//表示质量为j的钱币,含有的最小的价值
代码:
#...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 04:02:59   
                                阅读次数:
195
                             
                    
                        
                            
                            
                                B-number
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2168    Accepted Submission(s): 1165
Problem Description
A wqb-number, or ...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 03:32:19   
                                阅读次数:
240
                             
                    
                        
                            
                            
                                【题目】
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c)
The so...
                            
                            
                                分类:
其他好文   时间:
2014-05-18 03:15:50   
                                阅读次数:
287