1 /* I:1 ; V-5;X-10;L-50;C-100;D-500;M-1000*/ 2 class Solution{ 3 vector tokens; 4 vector token_value; 5 public: 6 /*divide the strin...
分类:
其他好文 时间:
2014-10-27 22:45:06
阅读次数:
288
题目链接~http://acm.hdu.edu.cn/showproblem.php?pid=4301非原创,看了好几个大神的题解,才看懂代码::刚开始看bin神的,看了半天没看懂,我太菜了%>_ 2 #include 3 using namespace std; 4 /* 5 d...
分类:
其他好文 时间:
2014-10-27 22:42:47
阅读次数:
160
题目链接~http://acm.hdu.edu.cn/showproblem.php?pid=4301非原创,看了好几个大神的题解,才看懂代码::刚开始看bin神的,看了半天没看懂,我太菜了%>_ 2 #include 3 using namespace std; 4 /* 5 d...
分类:
其他好文 时间:
2014-10-27 21:04:24
阅读次数:
150
Divide Two IntegersDivide two integers without using multiplication, division and mod operator.SOLUTION 11. 基本思想是不断地减掉除数,直到为0为止。但是这样会太慢。2. 我们可以使用2分法来加...
分类:
其他好文 时间:
2014-10-24 22:02:06
阅读次数:
279
Divide GroupsTime Limit: 1000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:475164-bit integer IO format:%I64d Java class name:...
分类:
其他好文 时间:
2014-10-21 21:09:56
阅读次数:
230
Divide two integers without using multiplication, division and mod operator.分析:题目意思很容易理解,就是不用乘除法和模运算求来做除法,很容易想到的一个方法是一直做减法,然后计数,超时。在网上找到一种解法,利用位运算,意思是...
分类:
其他好文 时间:
2014-10-21 02:10:36
阅读次数:
185
Divide two integers without using multiplication, division and mod operator.分析:不能用乘、除、取模运算,我们可以用的运算还有加、减、位运算。一个比较简单的想法是在dividend上不断减去divisor,知道余数小于div...
分类:
其他好文 时间:
2014-10-20 21:18:28
阅读次数:
183
1、新建立一个Android工程package com.shellway.junit;public class Service { public int divide(int a,int b){ return a/b; }}Service.java.作为被测试类...
分类:
移动开发 时间:
2014-10-20 08:38:44
阅读次数:
309
题意:给出n个红点,m个蓝点。问是否存在一条直线使得红点和蓝点分别分布在直线的两侧,这些点不能再直线上。分析:求出两种点的凸包,如果两个凸包相离的话,则存在这样一条直线。判断凸包相离需要判断这两件事情:任何一个凸包的任何一个顶点不能在另一个凸包的内部或者边界上。两个凸包的任意两边不能相交。二者缺一不...
分类:
其他好文 时间:
2014-10-20 02:05:42
阅读次数:
302
///题意:给出一棵树,树的边上都有边权值,求从一点出发的权值和最大,权值为从一点出去路径上边权的最小值
# include
# include
# include
# include
using namespace std;
# define MAX 200010
struct node
{
int u,v;
int w;
};
struct node a[MAX];
_...
分类:
其他好文 时间:
2014-10-19 23:19:52
阅读次数:
187