Goffi and Median
Problem Description
A median in a sequence with the length of n is an element which occupies position number ?n+12? after we sort the elements in the non-decreasing order ...
分类:
其他好文 时间:
2014-08-25 11:55:34
阅读次数:
159
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please...
分类:
其他好文 时间:
2014-08-25 10:06:04
阅读次数:
198
UVA 10909 - Lucky Number
题目链接
题意:问一个数字能否由两个lucky num构造出来,lucky num根据题目中的定义
思路:利用树状数组找前k大的方法可以构造出lucky num的序列,然后每次查找n,就从n / 2开始往下查找即可
代码:
#include
#include
#include
using namespace st...
分类:
其他好文 时间:
2014-08-24 23:52:53
阅读次数:
423
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate...
分类:
其他好文 时间:
2014-08-24 23:34:33
阅读次数:
259
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb...
分类:
其他好文 时间:
2014-08-24 23:29:33
阅读次数:
176
LeetCode: Sum Root to Leaf NumbersGiven a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is t...
分类:
其他好文 时间:
2014-08-24 20:41:33
阅读次数:
175
题目描述:
Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1={11, 12, 13, 14} is 12, and the median of S2={9, 10, 15, 16, 17} is 15. The median of two sequences is defined to be...
分类:
其他好文 时间:
2014-08-24 19:24:22
阅读次数:
235
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers....
分类:
其他好文 时间:
2014-08-24 19:14:43
阅读次数:
211
problem A#includeint a[500]={0};//素数大表 int main(){ int number; int anumber=0; int i=0; int flag=0; while(scanf("%d",&number)!=EOF) { if(anumber==0) .....
分类:
其他好文 时间:
2014-08-24 19:12:03
阅读次数:
162
可见性:
我们希望确保一个线程修改了对象的状态后,其他线程能够看到发生的状态变化。
例:在没有同步的情况下共享变量
public class NoVisibility {
private static boolean ready;
private static int number;
public static class Rea...
分类:
编程语言 时间:
2014-08-24 15:31:02
阅读次数:
190