This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.
Input Specification:
Each input file contains o...
分类:
其他好文 时间:
2015-03-04 09:55:46
阅读次数:
133
题意:给2~10个不同的数字,要求把这些数字分成两堆,每一堆任意组合成一个数(开头不能为0),求两个数差的最小值。
思路:数据很小,直接暴力枚举所有情况,并且很容易想到,要使差最小则这两个数的位数应该尽量相等;枚举排列时用到了next_permutation函数。...
分类:
其他好文 时间:
2015-03-03 22:16:38
阅读次数:
265
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest number in the BST.
Note: next()...
分类:
其他好文 时间:
2015-03-03 01:12:50
阅读次数:
227
那么,如何制作这样一个效果呢,关键点在哪里呢?
做法其实可以有多种,
1)可以直接继承ImageView,然后在ImageView的OnDraw函数中直接绘制圆形或者方形的高亮圈;
2)也可以直接继承View,自己将Bitmap给传进来,在onDraw函数中先绘制图片,接着利用Path来绘制这个圆形或者方形的选择区域,利用Region.OP.DIFFERENCE来反向获取蒙板层。
不过利用clipPath来实现这个蒙板层的绘制,画出来的圆形会有锯齿,这个目前我还没有找到比较好的办法去掉这个锯齿,不知道有没有...
分类:
其他好文 时间:
2015-02-28 18:37:55
阅读次数:
148
Both Digiprog 3 odometer programmer and Tacho pro 2008 are top selling mileage odometer corrections tool. Do they have same and difference functions?B...
分类:
其他好文 时间:
2015-02-26 18:13:53
阅读次数:
150
The difference here is that : char *s = "hello,world!";will place hello,world in read-only part of the memmory and makes s a pointer to that. makin...
分类:
其他好文 时间:
2015-02-24 22:13:31
阅读次数:
231
Given an integer array, adjust each integers so that the difference of every adjcent integers are not greater than a given number target.If the array ...
分类:
其他好文 时间:
2015-02-23 15:26:38
阅读次数:
115
【题意】:给出两个数 m n,第一个数是另外两个数a b的和,第二个数是a b的差的绝对值(absolute difference)。输出这两个数a b,大的在前。
【思路】:大的数等于 (m+n)/2,小的等于m-大的。
【注意】:impossible的判断。分两种,一种是m如果m+n为奇数,则a b不存在。
【AC代码】:
#include
#include
#include
#...
分类:
其他好文 时间:
2015-02-23 09:40:29
阅读次数:
118
For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Sp...
分类:
其他好文 时间:
2015-02-20 20:51:10
阅读次数:
221
The difference of 0 & '0' & '\0'
------------------------------------------------------------
0 is a number(decimal).
------------------------------------------------------------
'0' is a char. It...
分类:
其他好文 时间:
2015-02-18 11:52:47
阅读次数:
104