[HDU3709]Balanced Number 试题描述 A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, ...
分类:
其他好文 时间:
2016-12-02 22:00:06
阅读次数:
298
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo... ...
分类:
其他好文 时间:
2016-11-30 11:26:51
阅读次数:
281
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo ...
分类:
其他好文 时间:
2016-11-30 03:37:22
阅读次数:
154
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r ...
分类:
其他好文 时间:
2016-11-30 02:31:27
阅读次数:
178
Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki... ...
分类:
其他好文 时间:
2016-11-29 14:49:41
阅读次数:
193
Solution 1: Reservior sampling: (wiki introduction) Reservoir sampling is a family of randomized algorithms for randomly choosing a sample of k items ...
分类:
其他好文 时间:
2016-11-29 09:28:31
阅读次数:
247
根据奇偶开两个hash表来记录后缀和。注意set会被卡,要手写hash表。 具体见代码: ...
分类:
其他好文 时间:
2016-11-28 20:07:45
阅读次数:
131
You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single ...
分类:
其他好文 时间:
2016-11-28 09:34:13
阅读次数:
252
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num ...
分类:
其他好文 时间:
2016-11-27 08:04:25
阅读次数:
188