码迷,mamicode.com
首页 >  
搜索关键字:seq    ( 2762个结果
Educational Codeforces Round 46 (Rated for Div. 2) D. Yet Another Problem On a Subsequence
这个题是dp, dp[i]代表以i开始的符合要求的字符串数 j是我们列举出的i之后一个字符串的开始地址,这里的C是组合数 dp[i] += C(j i 1, A[i]] ) dp[j]; include include include include include include include ...
分类:其他好文   时间:2018-06-29 21:38:41    阅读次数:177
249. Group Shifted Strings
问题描述: Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the ...
分类:其他好文   时间:2018-06-29 01:17:37    阅读次数:221
python-一个小练习
myseq = '''[a:1,b:2,c:3] [a:3,b:3,c:8] [a:7,c:2:m:7,r:4] [a:2,c:4:m:6,r:4] [a:3,b:2,c:7,o:5]''' def eve(i): evest='' for x in [y for y in range(len(i)... ...
分类:编程语言   时间:2018-06-27 17:34:32    阅读次数:232
Codeforces Round #361 (Div. 2) D - Friends and Subsequences
题目大意:给你两个长度为n的数组a, b,问你有多少个问你有多少个区间满足 a中最大值等于b中最小值。 思路:我本来的想法是用单调栈求出每个点的管辖区间,然后问题就变成了巨麻烦的线段覆盖问题,就爆炸写了 一晚上假算法。正解就是枚举一个端点,然后二分找右端点的区间,因为满足一个很神奇的单调性,然后st ...
分类:其他好文   时间:2018-06-27 13:54:57    阅读次数:160
leetcode 377. Combination Sum IV
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. ...
分类:其他好文   时间:2018-06-24 16:05:45    阅读次数:162
CF 612C. Replace To Make Regular Bracket Sequence【括号匹配】
【链接】: "CF" 【题意】:给你一个只含有括号的字符串,你可以将一种类型的左括号改成另外一种类型,右括号改成另外一种右括号 问你最少修改多少次,才能使得这个字符串匹配,输出次数 【分析】: 本题用到了栈。如果遇上左括号,就加进栈里。如果遇上右括号,就判断栈里的左括号是否和它匹配,不匹配就加一。不 ...
分类:其他好文   时间:2018-06-23 00:08:09    阅读次数:167
代码视图分析
1 /* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not us... ...
分类:其他好文   时间:2018-06-22 21:48:22    阅读次数:196
TCP(一)
TCP的特点:三次握手、四次挥手、可靠连接、丢包重传。所有的关键词都围绕着可靠传输。 实现可靠传输的核心机制:seq+ack。通过ack判断是否有丢包,是否需要重传。 三次握手 1)初始状态:client为CLOSED,server为LISTEN,此时client 发送 syn 到server ,c ...
分类:其他好文   时间:2018-06-22 10:17:42    阅读次数:209
[python]python之tuple元组
tuple特性 tuple支持运算符 python表达式 | 描述 : : | : : len() | 计算元素个数 + | 连接 | 复制 in | 元素是否存在 for x in tuple:print x | 迭代 tupel元素截取 python表达式 | 描述 : : | : : L[N] ...
分类:编程语言   时间:2018-06-22 01:04:04    阅读次数:214
Sequence contains no elements : LINQ error
1.错误意思: 出现错误的原因是:你要从一个null中取的数据。 2.错误的处理 1,使用FirstOrDefault() 来代替 First() 2、使用SingleOrDefault 来代替 Single 3、使用 ElementAtOrDefault 来代替 .ElementAt 4、如果是在 ...
分类:其他好文   时间:2018-06-21 13:42:07    阅读次数:2627
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!