码迷,mamicode.com
首页 >  
搜索关键字:combination sum ii    ( 27716个结果
D_Dp
/* D - 简单dp 例题 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum ...
分类:其他好文   时间:2014-07-18 22:23:25    阅读次数:231
10165 - Stone Game(Nim游戏)
UVA 10165 - Stone Game 题目链接 题意:给定n堆石子,每次能在一堆取1到多个,取到最后一个赢,问谁赢 思路:就裸的的Nim游戏,利用定理求解 代码: #include #include int n, num; int main() { while (~scanf("%d", &n) && n) { int sum = 0; ...
分类:其他好文   时间:2014-07-18 22:17:20    阅读次数:342
一种基于uCos-II操作系统和lwIP协议栈的IEEE-1588主站以及基于该主站的报文处理方法
本发明公开了一种基于uCos‐II操作系统和lwIP协议栈的IEEE‐1588主站以及应用于电力系统的支持IEEE‐1588协议的主时钟(IEEE‐1588主站)的实现方法。该方法是在一个低成本的硬件平台上,借助uCos‐II操作系统和TCP/IP的协议栈,对以太网数据进行了分类处理,实现了在同一个...
分类:其他好文   时间:2014-07-18 22:05:27    阅读次数:741
[LeetCode]N-Queens II
[LeetCode]N-Queens II...
分类:其他好文   时间:2014-07-18 22:02:58    阅读次数:200
BZOJ 1874 取石子游戏 (NIM游戏)
题解:简单的NIM游戏,直接计算SG函数,至于找先手策略则按字典序异或掉,去除石子后再异或判断,若可行则直接输出。#include const int N=1005;int SG[N],b[N],hash[N],a[N],sum,tmp,i,j,n,m; void FSG(int s){ ...
分类:其他好文   时间:2014-07-18 21:09:31    阅读次数:206
SGU 152.Making round
不断向下取直到,忽略的数累计到一个百分比,给当前百分比加1。 这道题要避免处理浮点数,用余数来处理,不然会wa 9 #include #include using namespace std;int g[10001];int x, n, sum, le;int main() { cin >>...
分类:其他好文   时间:2014-07-17 23:21:20    阅读次数:197
LeetCode Jump Game II
class Solution {private: vector sum; vector step; set can;public: int jump(int A[], int n) { step.clear(), sum.clear(), can.clear()...
分类:其他好文   时间:2014-07-17 18:36:56    阅读次数:221
子序列的和
输入两个正整数nint main(){ int n,m,i; double sum; while(~scanf("%d %d",&n,&m)) { sum=0; for(i=n;i<=m;i++) { sum+=...
分类:其他好文   时间:2014-07-17 14:29:32    阅读次数:300
[LeetCode] Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:其他好文   时间:2014-07-17 14:03:41    阅读次数:293
LeetCode "Sum Root to Leaf Numbers"
A typical DFS usage, no big deal:class Solution {public: int dfs(TreeNode *p, int pval) { if( !p->left && !p->right ) { ...
分类:其他好文   时间:2014-07-17 09:55:25    阅读次数:171
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!