Tree
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 13528
Accepted: 4350
Description
Give a tree with n vertices,each edge has a length(positive integer l...
分类:
其他好文 时间:
2015-07-31 18:33:22
阅读次数:
92
Mining Your Own BusinessTime Limit: 1000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:384464-bit integer IO format:%I64d Java ...
分类:
其他好文 时间:
2015-07-31 18:13:01
阅读次数:
104
compare从这里可以看出,compare是Comparator接口中的一个类,再看一下源代码中的解释 Compares its two arguments for order. Returns a negative integer,zero, or a positive integer as t...
分类:
编程语言 时间:
2015-07-31 14:35:53
阅读次数:
168
Question: Given an Integer, you need to determine if it is a palindrome or not. You should not use any extra space in the process.Input: 121Output: Pa...
分类:
其他好文 时间:
2015-07-31 12:31:03
阅读次数:
132
DZY Loves ColorsTime Limit: 2000msMemory Limit: 262144KBThis problem will be judged onCodeForces. Original ID:445E64-bit integer IO format:%I64d Java ...
分类:
其他好文 时间:
2015-07-31 12:15:32
阅读次数:
238
开发过程中我们经常会用到三目运算符,那下面的的两种情况你能说一下那种更合理吗用法A:...Map result = new HashMap()......Integer count = result.get(key);count == null ? result.put(key,1) : resul...
分类:
编程语言 时间:
2015-07-31 12:12:14
阅读次数:
181
【059-Spiral Matrix II(螺旋矩阵II)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
For example,
Given n = 3,
Yo...
分类:
编程语言 时间:
2015-07-31 07:50:51
阅读次数:
179
Given an integer, write a function to determine if it is a power of two.
题目意思:判断某个数是否是2的幂。
方法:直接进行bit运算,判断是否这个数二进制位里有且仅有一个1。
class Solution {
public:
bool isPowerOfTwo(int n) {
int c=0;...
分类:
其他好文 时间:
2015-07-31 01:24:20
阅读次数:
90
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=14340思路:模拟手动加法运算(1)大数用数组存储,逆序(2)计算两个数每一位相加,然后进位#include#include#define N 110void add();voi...
分类:
其他好文 时间:
2015-07-30 22:53:05
阅读次数:
138
一、对象和类型 1、五种基本数据类型: 1、字符串(String),简记为str,使用''或""括起来的一系列字符串 2、整数(integer),简记为int,十进制、八进制、十六进制 3、浮点数(float),例如1.48, 21.0, 21., .21, 21.E2 4...
分类:
编程语言 时间:
2015-07-30 18:56:21
阅读次数:
213