Determine whether an integer is a palindrome. Do this without extra space.解题思路:由于题目中给定不能使用额外空间开销,因此不能转为String类型,我们需要一位一位处理。Java代码如下: static public boo...
分类:
编程语言 时间:
2015-04-26 10:42:59
阅读次数:
131
很多初学C++者,都会从控制台入手,但写出来的代码经常一闪而过,(有的编译器不会出现这样的情况)。
例如:#include
using namespace std;
//main函数是一个程序的入口
//int是整数类型(integer)
//main函数的返回值是整数类型,所以要在函数名称前声明返回类型(int)
int main()
{
cout<<"Hello wor...
分类:
编程语言 时间:
2015-04-26 09:33:55
阅读次数:
150
uva 10891 Game of Sum (DP)
This is a two player game. Initially there are n integer numbers in an array and players
A and B get chance to take them alternatively. Each player can take one o...
分类:
其他好文 时间:
2015-04-26 09:31:20
阅读次数:
140
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are s...
分类:
其他好文 时间:
2015-04-26 06:58:15
阅读次数:
108
LARGE_INTEGER litmp;LARGE_INTEGER qt1, qt2;QueryPerformanceFrequency(&litmp);double dff = (double)litmp.QuadPart;QueryPerformanceCounter(&qt1); int *a...
分类:
其他好文 时间:
2015-04-25 23:57:28
阅读次数:
320
进化之地(Evoland)Time Limit: 1000msCase Time Limit: 1000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainSubmit Status PID: 491....
分类:
其他好文 时间:
2015-04-25 22:44:16
阅读次数:
192
Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
分类:
其他好文 时间:
2015-04-25 22:40:26
阅读次数:
147
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321解题思路:将数字翻转并不难,可以转成String类型翻转,也可以逐位翻转,本题涉及到的主要是边界和溢出问题,使用Long...
分类:
编程语言 时间:
2015-04-25 22:38:15
阅读次数:
167
HotelTime Limit: 3000msMemory Limit: 65536KBThis problem will be judged onPKU. Original ID:366764-bit integer IO format:%lld Java class name:MainThe c...
分类:
其他好文 时间:
2015-04-25 19:40:22
阅读次数:
148
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 number of bits in the code, print the sequence of ...
分类:
其他好文 时间:
2015-04-25 18:26:11
阅读次数:
139