/**
* Say you have an array for which the ith element is the price of a given stock on day i.
* Design an algorithm to find the maximum profit. You may complete as many transactions as you like
* ...
分类:
其他好文 时间:
2014-10-07 11:10:03
阅读次数:
129
[问题描述]Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioni...
分类:
其他好文 时间:
2014-10-07 01:23:32
阅读次数:
341
摘要:Part I分析了GPU客户端之间存在的同步问题,以及Chromium的GL扩展同步点机制的基本原理。本文将源代码的角度剖析同步点(SyncPoint)机制的实现方式。同步点机制的实现主要涉及到是如何跨进程实现两个GL扩展接口InsertSyncPointCHROMIUM和WaitSyncPointCHROMIUM的实现方式,以及如何实现GPU服务端的同步点等待。...
分类:
其他好文 时间:
2014-10-06 13:53:50
阅读次数:
132
【leetcode】Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s....
分类:
其他好文 时间:
2014-10-06 12:12:00
阅读次数:
149
class Solution {
public:
vector getRow(int rowIndex) {
vector result;
int i = 0;
int j = 0;
if(rowIndex < 0) {
return result;
}
result....
分类:
其他好文 时间:
2014-10-06 00:58:39
阅读次数:
220
H. 硬币水题II
Time Limit: 1000ms
Case Time Limit: 1000ms
Memory Limit: 65536KB
64-bit integer IO format: %lld Java class name: Main
Submit Status PID:
29064
Font Size:
+
-
...
分类:
其他好文 时间:
2014-10-05 22:07:59
阅读次数:
167
/*
意思就是:
给定一个三角形,求得和最小的路径。每层只能选一个整数,上一层和下一层的整数必须是相邻的。
思路:
1,动态规划。到第i层的第k个顶点的最小路径长度表示为f(i,k),则f(i, k) = min{f(i-1,k), f(i-1,k-1)} + d(i, k); 其中d(i, k)表示原来三角形数组里 的第i行第k列的元素。则可以求得从第一行到最终到第length-1行第...
分类:
其他好文 时间:
2014-10-05 22:06:19
阅读次数:
163
题目大意:给定一个由‘W','I','N','G'构成的字符串,给定一些规则,这些规则可以将两个字符合成为一个,例如"II"可以合成为'W',"WW"可以合成为'I'或者'N'
求这个字符串可以最终合成为哪几种字符
看到这题我想到了广搜。。。其实没必要,动归完全可以解决
令f[i][j][k]为从i开始的j个字符是否可以合成为字符[k]
然后j从外层循环,剩下的全部预处理,怎么暴力怎么转移...
分类:
其他好文 时间:
2014-10-04 17:25:07
阅读次数:
234
假设你有一个数组,它的第i个元素是一个股票在一天的价格。
设计一个算法,找出最大的利润。...
分类:
其他好文 时间:
2014-10-04 16:57:46
阅读次数:
122
/*
*
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2014-10-04 14:32:16
阅读次数:
211