C. Are They All Integers? 题意:是给定n个数字判断对任意的(a[j]-a[i])/a[k]一定要是整数。 题解: 一开始以为用枚举会超时不过还是试了下,没想到没超时,直接过了,题目很简单,简单枚举就好。 #include<iostream> using namespace ...
分类:
其他好文 时间:
2020-04-02 01:39:20
阅读次数:
158
Problem : Given two arrays, write a function to compute their intersection. Example 1: Example 2: Note: Each element in the result must be unique. The ...
分类:
其他好文 时间:
2020-04-02 01:22:47
阅读次数:
64
第一种方法:直接采用随机赋值的方法 1.在初始时任意指派(真l_True 或者 假l_False) 2.回溯阶段采用技术,保留原来相位,相位转换交给回溯层变元翻转。 1 // Revert to the state at given level (keeping all assignment at ...
分类:
其他好文 时间:
2020-04-01 19:40:30
阅读次数:
100
Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va ...
分类:
其他好文 时间:
2020-04-01 00:34:43
阅读次数:
61
题目描述 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations pe ...
分类:
其他好文 时间:
2020-03-31 18:48:00
阅读次数:
81
E - Power Strings Given two strings a and b we define ab to be their concatenation. For example, if a = "abc" and b = "def" then ab = "abcdef". If we ...
分类:
其他好文 时间:
2020-03-31 14:21:25
阅读次数:
63
package LeetCode_1064 /** * 1064. Fixed Point * Lock by LeetCode * Given an array A of distinct integers sorted in ascending order, return the smalles ...
分类:
其他好文 时间:
2020-03-31 14:06:29
阅读次数:
69
题目 Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between and is a ...
分类:
其他好文 时间:
2020-03-31 01:13:11
阅读次数:
88
题目描述 Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...
分类:
其他好文 时间:
2020-03-30 12:48:40
阅读次数:
69
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi ...
分类:
其他好文 时间:
2020-03-30 12:40:30
阅读次数:
66