Given two numbers, hour and minutes. Return the smaller angle (in sexagesimal units) formed between the hour and the minute hand. Example 1: Input: ho ...
分类:
其他好文 时间:
2020-02-13 09:30:42
阅读次数:
57
知识点:c++中将string转换为int 于double的函数(原来还有这种好东西) 转化为int,有两种方式: string s = "123"; int c = atoi(s.c_str()); 或者int c = stoi(s);将string转化为double,也是两种方式。string ...
分类:
其他好文 时间:
2020-02-13 00:21:28
阅读次数:
137
// 因为N被连续整数 5*6*7整除的结果是3,而3只是相对于连续整数的产物,说明重点是找出连续整数,。//所以大致题意就是给出一个N,找出一段连续整数,使得N被整除。 //观察样例给出的答案发现,N不会被除自身以外大于sqrt(N)的数整除。//可以用两个for循环暴力枚举。 #include" ...
分类:
其他好文 时间:
2020-02-12 22:03:56
阅读次数:
66
(1)数组排序及插入元素 1 package JavaEE.JavaBaseExampleTest.Array; 2 3 import java.util.Arrays; 4 /** 5 * 使用sort()方法对Java数组进行排序,及使用 insertElement () 方法向数组插入元素 6 ...
分类:
编程语言 时间:
2020-02-12 16:15:53
阅读次数:
81
200. Numbers of Islands *********************** class Solution { // 首先定义四个方向的向量,方便计算矩阵上下左右的位置 final static int [][]dirs = {{-1, 0}, {1, 0}, {0, -1}, { ...
分类:
其他好文 时间:
2020-02-12 11:16:57
阅读次数:
91
In a row of dominoes, A[i] and B[i] represent the top and bottom halves of the i-th domino. (A domino is a tile with two numbers from 1 to 6 - one on ...
分类:
其他好文 时间:
2020-02-11 11:48:25
阅读次数:
101
The Travelling Salesman spends a lot of time travelling so he tends to get bored. To pass time, he likes to perform operations on numbers. One such op ...
分类:
其他好文 时间:
2020-02-11 00:15:05
阅读次数:
66
题目描述很清楚,最容易想到的就是从前往后一次相加即可。 题中所给的数据结构描述: 第一次的算法: class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode res=new ListNode( ...
分类:
其他好文 时间:
2020-02-10 22:56:54
阅读次数:
120
Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896]Output: 2Explanat ...
分类:
其他好文 时间:
2020-02-10 17:53:55
阅读次数:
65
Python函数中的必选/默认/可变/关键字/命名参数 一、默认参数 n为默认参数,直接赋值 默认参数设置的两个注意事项: 1.必选参数在前,默认参数在后,否则会报错 2.当函数有多个参数时,把变化大的参数放前面,变化小的参数放后面。变化小的参数就可以作为默认参数。 二、可变参数 在python中, ...
分类:
编程语言 时间:
2020-02-10 11:59:57
阅读次数:
91