题意:
有n个人,两两都有比赛,然后有每个人的胜场次数。
规定把比自己胜场次数多的人都赢了的就是strong(weak) king (vegetables)
(why i say that they are so weak?
:****,how do you think a person who beat the heroes but defeated at the dogface? ...
分类:
其他好文 时间:
2015-01-07 11:03:03
阅读次数:
244
题目大意:有n个人之间互相竞赛,现在给出每个人赢了多少局。若定义一个人是最高分或者这个人赢了所有比他分高的人,那么这个人就算赢了。问最多可能有多少人赢。
思路:最大流模型的另一种应用。二分图,左边是所有选手,右边是所有比赛。
S->所有选手 f:该选手赢了多少局
所有比赛->T f:1
由于最多只有十个人,所以枚举答案就行了。枚举最多有多少人赢了,如果一个分比较低的人赢了,那么分比...
分类:
其他好文 时间:
2015-01-07 09:24:41
阅读次数:
147
poj1050:http://poj.org/problem?id=1050* maximum-subarray 问题的升级版本~本题同样是采用DP思想来做,同时有个小技巧处理:就是把二维数组看做一维数组。怎么去看呢,我们可以吧具有同样列号的数捆绑到一起,比如 a[1][1], a[2][1], a...
分类:
其他好文 时间:
2015-01-07 00:32:16
阅读次数:
184
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-01-06 23:07:00
阅读次数:
208
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example:Given the below binary tree, 1 / \ 2 3...
分类:
其他好文 时间:
2015-01-06 17:38:16
阅读次数:
199
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 at most two transactions.
Note:
You may ...
分类:
其他好文 时间:
2015-01-06 15:41:54
阅读次数:
189
最近在windows下使用通过多线程使用jdbc操作数据库,在线程数设置为5,并且每个线程执行完成后Sleep(1000),在这种情况下,竟然还会报错:java.net.SocketException No buffer space available (maximum connections re...
https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/http://blog.csdn.net/linhuanmars/article/details/19659525/**
*Definitionforbinarytree
*publicclassTreeNode{
*intval;
*TreeNodeleft;
*TreeNoderight;
*TreeNode(intx){val=x;}
*}
*/
publicclassSoluti..
分类:
其他好文 时间:
2015-01-06 12:08:50
阅读次数:
184
一:meta信息(1) width-viewport的宽度height-viewport的高度 initial-scale-初始的缩放比例 minimum-scale-允许用户缩放到的最小比例 maximum-scale-允许用户缩放到的最大比例 user-scalable-用户是否可以手...
分类:
移动开发 时间:
2015-01-06 11:23:51
阅读次数:
149
Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?...
分类:
其他好文 时间:
2015-01-05 21:49:59
阅读次数:
240