#Week_1# #From LeetCode# Description: Given an array of size n, find the majority element. The majority element is the element that appears more than ...
分类:
其他好文 时间:
2017-09-08 21:50:19
阅读次数:
285
* 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精确的浮点数运算,包括加减乘除和四舍五入 import java.math.BigDecimal;/** 计算工具类 */ public class Arith { /** 加 * 提供精确的加法运算。 * @param v1 被... ...
分类:
编程语言 时间:
2017-09-05 00:12:32
阅读次数:
296
HackerRank <!--Client--> <!--Client--> 1305 Pairwise Sum and Divide 有这样一段程序,fun会对整数数组A进行求值,其中Floor表示向下取整: fun(A) sum = 0 for i = 1 to A.length for j = ...
分类:
其他好文 时间:
2017-09-03 18:48:15
阅读次数:
113
问题: 最近在写一个程序界面,有一个scrollVIew,其中有一段内容是需要在线加载的。 当内容加载完成后,ScrollView中内容的长度会发生改变,这时ScrollView会自动下滚,如下图所示: 滚动的那一下体验特别不好,所以要防止这种情况。即不论Scrollview中内容如何,都要保持在最 ...
分类:
移动开发 时间:
2017-09-02 15:43:20
阅读次数:
306
Output Input示例 Output示例 time limit exceeded second try: another: 1、观察算式:floor(A+B)/(A*B),不难发现,如果其中A.B都是>=2的数值,那么对应的值一定是0.那么根据这个特性我们继续讨论: ①如果A=1&&B=1,那 ...
分类:
其他好文 时间:
2017-09-01 13:34:03
阅读次数:
163
一、快速排序介绍 快速排序是C.R.A.Hoare于1962年提出的一种划分交换排序。它采用了一种分治的策略,通常称其为分治法(Divide-and-ConquerMethod)。 算法思想:1.先从数组中取出一个数组作为枢轴,一般情况下选取数组的第一个或者最后一个元素作为枢轴,当然可以选取其他的, ...
分类:
编程语言 时间:
2017-08-31 21:07:27
阅读次数:
150
Mega Man is off to save the world again. His objective is to kill the Robots created by Dr. Wily whose motive is to conquer the world. In each mission ...
分类:
其他好文 时间:
2017-08-31 17:53:39
阅读次数:
230
1、数学计算器 ①数学计算器接口[MathCalculator] public void add(int i,int j); public int sub(int i,int j); public int multi(int i,int j); public void divide(int i,in ...
分类:
编程语言 时间:
2017-08-29 20:43:48
阅读次数:
278
leetcode practice 用stack来存贮有意义的command最后形成有意义的command line ...
分类:
其他好文 时间:
2017-08-26 18:44:55
阅读次数:
165
#!/bin/bash # filename : jisuan.sh # description : add, subtract, multiply, and divide print_usage(){ echo -e "USAGE:$0 NUM1 {+|-|*|%} NUM2" exit 1}if ...
分类:
系统相关 时间:
2017-08-25 12:32:29
阅读次数:
260