#include<iostream> using namespace std ; const int N=1010; int f[N]; int a[N]; int n; int main() { cin>>n; for(int i=1; i<=n; i++) cin>>a[i]; for(int ...
分类:
其他好文 时间:
2020-01-28 19:33:31
阅读次数:
71
题意 输出字符串数组中所有字符串的最长公共前缀。 思路 直接判断就好了,时间复杂度$O(len \times n)$,$n$为字符串的数量,$len$为所有字符串中最短的字符串的长度。 代码 总结 战胜95%,头一回。 ...
分类:
其他好文 时间:
2020-01-27 00:15:43
阅读次数:
84
1104 Sum of Number Segments (20分) Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the s ...
分类:
其他好文 时间:
2020-01-26 19:20:05
阅读次数:
96
一、题目说明 Longest Palindromic Substring,求字符串中的最长的回文。 Difficuty是Medium 二、我的实现 经过前面4个题目,我对边界考虑越来越“完善”了。 总共提交了5次: 第1、2次:Wrong Answer 主要是 "cbbd" 错误了,重复的判断逻辑上 ...
分类:
其他好文 时间:
2020-01-26 13:14:42
阅读次数:
62
Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, a ...
分类:
其他好文 时间:
2020-01-25 15:29:55
阅读次数:
87
Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi ...
分类:
其他好文 时间:
2020-01-24 10:50:25
阅读次数:
98
一、题目 Longest Substring Without Repeating Characters,具体请自行搜索。 这个题目,我看了一下,经过一番思考,我觉得实现起来不是很复杂。 但要做到bug free有点难度,主要是边界的问题。 二、这个题目,我自己实现,没有参考代码 提交了5次: 第1次 ...
分类:
其他好文 时间:
2020-01-24 09:14:31
阅读次数:
75
IP 转发分组的流程 数据路由 :路由器在不同网段转发数据包; 网络畅通的条件 :数据包能去能回; 从源网络发出时,沿途的每一个路由器必须知道到目标网络下一跳给哪个接口; 从目标网络返回时,沿途的每一个路由器必须知道到源网络下一跳给哪个接口; 可以看到网段1~5对应的地址主机号都是归零的,即配置路由 ...
分类:
其他好文 时间:
2020-01-23 17:00:28
阅读次数:
260
题意: 找出树上异或和最大的一条路径$p$ $$ _{xor}length(p)=\oplus_{e\in_p}w(e) $$ 01字典树。同样用到了简单的异或性质 $0\oplus a = a, a\oplus a = 0$ 定义$f(u,v)$为$u$到$v$的路径异或和。那么$f(u,v) = ...
分类:
其他好文 时间:
2020-01-22 20:12:45
阅读次数:
64
Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into sets of k consecutive numbersReturn Tru ...
分类:
其他好文 时间:
2020-01-18 10:37:01
阅读次数:
92