Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integer...
分类:
其他好文 时间:
2015-04-06 11:29:06
阅读次数:
121
1 program dijkstra; 2 var 3 a:array[1..100,1..100]of integer; 4 flag:array[1..100]of boolean; 5 w,x,n,i,j,min,minn:integer; 6 begin 7 ...
分类:
其他好文 时间:
2015-04-06 06:12:04
阅读次数:
139
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in...
分类:
其他好文 时间:
2015-04-05 23:20:17
阅读次数:
177
题目:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ...
分类:
其他好文 时间:
2015-04-05 21:47:56
阅读次数:
145
Odd PersonalityTime Limit: 2000msMemory Limit: 32768KBThis problem will be judged onLightOJ. Original ID:130064-bit integer IO format:%lld Java class ...
分类:
其他好文 时间:
2015-04-05 20:27:55
阅读次数:
164
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.The first integer of each...
分类:
其他好文 时间:
2015-04-05 17:33:31
阅读次数:
125
一:Integer to Roman
题目:
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
链接:https://leetcode.com/problems/integer-to-roman/
分析:此题...
分类:
其他好文 时间:
2015-04-05 16:02:09
阅读次数:
156
Real Life TrafficTime Limit: 2000msMemory Limit: 32768KBThis problem will be judged onLightOJ. Original ID:129164-bit integer IO format:%lld Java clas...
分类:
其他好文 时间:
2015-04-05 15:59:33
阅读次数:
154
class Solution {public: int atoi(string str) { long long result=0; int flag=1; int i=0; while(str[i]==' '&&str[i]!='\0'...
分类:
其他好文 时间:
2015-04-05 15:56:47
阅读次数:
116
Ant HillsTime Limit: 2000msMemory Limit: 32768KBThis problem will be judged onLightOJ. Original ID:106364-bit integer IO format:%lld Java class name:M...
分类:
其他好文 时间:
2015-04-05 15:46:45
阅读次数:
182