码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
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
LA 4394
DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. Wi...
分类:其他好文   时间:2014-07-18 17:12:31    阅读次数:252
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
NY 325 zb的生日
假设所有西瓜重 Asum,所求的是用 Asum / 2 的背包装,最多装下多少。刚开始用贪心作的,WA。后来用01背包,结果TLE,数据太大。原来用的是深搜!dfs(int sum, int i) 表示当前装已了 sum,对第 i 个进行决策。用时1200多MS,不知道大牛们60MS是怎么搞的,泥煤...
分类:其他好文   时间:2014-07-17 22:36:47    阅读次数:255
uva10827-Maximum sum on a torus(矩阵最大和的变形)
题目;uva10827-Maximum sum on a torus(矩阵最大和的变形) 题目大意:就是uva108的变形,矩阵能够连通,就是可以从后面连到前面。这里把矩阵复制三遍,然后重新生成一个大的矩阵,就可以解决联通的问题。再枚举矩阵的起点和终点所有情况,保留最大值就可以了。 例如:1 2 3        2 3 4 新的矩阵: 1 2 3  1 2 3         ...
分类:其他好文   时间:2014-07-17 19:36:02    阅读次数:201
POJ 2739 Sum of Consecutive Prime Numbers
?? Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18782   Accepted: 10308 Description Some positive integers can be represen...
分类:其他好文   时间:2014-07-17 19:15:16    阅读次数:260
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
Teamcenter10 step-by-step installation in Linux env-Teamcenter Server Installation
Introduction In the post, we will start to deploy two-tier Teamcenter env step by step. We will use the following two Teamcenter installation tools wh...
分类:系统相关   时间:2014-07-17 13:09:01    阅读次数:1536
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!