题目描述 假设按照升序排序的数组在预先未知的某个点上进行了旋转。 ( 例如,数组?[0,1,2,4,5,6,7] 可能变为?[4,5,6,7,0,1,2]?)。 请找出其中最小的元素。 注意数组中可能存在重复的元素。 示例: 题目链接: https://leetcode cn.com/problem ...
分类:
编程语言 时间:
2020-04-29 23:19:55
阅读次数:
73
Problem : Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole arra ...
分类:
其他好文 时间:
2020-04-29 23:08:17
阅读次数:
65
Problem : Given a string, find the length of the longest substring without repeating characters. Example 1: Example 2: Example 3: 思路 : Solution (C++) ...
分类:
其他好文 时间:
2020-04-29 21:42:00
阅读次数:
51
``` //序列具有周期性 #include #include #include #include using namespace std; typedef long long ll; const int N=5e4+10; ll sum[N]; ll a,b,q; ll calc(ll x) { ... ...
分类:
其他好文 时间:
2020-04-29 18:21:24
阅读次数:
64
给定一个字符串,请你找出其中不含有重复字符的?最长子串?的长度。 示例?1: 输入: "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。 ...
分类:
其他好文 时间:
2020-04-28 23:28:54
阅读次数:
91
Error: initscripts conflicts with redhat-release-server-7.0-1.el7.x86_64 You could try using --skip-broken to work around the problem You could try ru ...
分类:
其他好文 时间:
2020-04-28 23:17:32
阅读次数:
179
什么是X Y 问题呢? 以下参考来自于耗子叔博客: 1. 想解决问题X 2. 他觉得Y可能是解决X的方法 3. 但是他不知道Y应该怎么做 4. 于是他去问别人Y应该怎么做? X Y Problem 最大的严重问题就是:在一个根本错误的方向上浪费了大量的时间和精力! 更多了解可以参考酷壳上的X Y P ...
分类:
其他好文 时间:
2020-04-28 15:21:30
阅读次数:
49
题目网址:http://class.51nod.com/Challenge/Problem.html#problemId=1046 快速幂的递归写法 当我知道快速幂之后。才发现 a ^ b还能这样算,太秀了吧,当然你必须带一些二分和递归,不然你看不懂它的递归式。会想(这TM是What ??? )数学 ...
分类:
其他好文 时间:
2020-04-28 13:23:57
阅读次数:
99
https://codeforces.com/contest/1342/problem/D 简单的叙述一下题意:有n个不大于k的数记录在m数组中,现在呢,需要我们将这n个数分组,对每个组的限制是,对于任何1~k的数字X,每组中不小于X的数字的个数不能大于C【X】,C数组输入时给定。现在需要我们计算出 ...
分类:
其他好文 时间:
2020-04-27 19:25:24
阅读次数:
57
https://vjudge.net/problem/UVA-11427 题目 每天晚上你都玩纸牌游戏,如果第一次就赢了就高高兴兴地去睡觉,否则就一直玩到(赢了的次数)/(玩了的次数)>p,才去睡觉。每一局的结果都是独立的,赢的概率是p,一天晚上最多玩n次,如果n次都没有达到睡觉的要求,那么就会灰心 ...
分类:
其他好文 时间:
2020-04-27 17:16:12
阅读次数:
51