背景:第一次打coderforces,只出了a,b两题·,c题在会长指导下过。
A:水
B:简单字符串处理
C:
题意是从A到B,不能走交叉点,求A到B最少要走的步数,等价于求与线段AB相交的直线个数。
证明:由于从A到B不能走直线交叉点,所以必须跨过其线段间的所有直线,每条直线只走一步就是最少。
解法:由于告诉了所有直线方程,只需根据若两点在直线异侧则直线在线段间。...
分类:
其他好文 时间:
2015-01-04 21:25:28
阅读次数:
138
Longest Common SubsequenceGiven two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.样例For "ABCD" and "ED...
分类:
其他好文 时间:
2015-01-03 15:55:06
阅读次数:
177
在javascript中有一个方法isDigit()使用来判断一个字符串是否都是数字,在java的字符串处理方法中没有这样的方法,觉得常常需要用到,于是上网搜了一下,整理出了两个用正则表达式匹配的判断方法,如下:// 判断一个字符串是否都为数字 public boolean isDigit(Str....
分类:
编程语言 时间:
2015-01-02 22:14:25
阅读次数:
158
作用:用于截取一个字符串中,两个标识符中间的字符串。
Public Function GetStr(ByVal InputString As String, ByVal String1 As String, ByVal String2 As String) As String
Dim i As Integer
Dim j As Inte...
分类:
其他好文 时间:
2015-01-02 19:58:34
阅读次数:
339
#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long long ll;#define N 2011111char str[1111];int s...
分类:
其他好文 时间:
2015-01-02 08:37:51
阅读次数:
111
LCS. 1 /* 1243 */ 2 #include 3 #include 4 #include 5 6 #define MAXN 2025 7 #define MAXM 256 8 9 char type[MAXM];10 int point[MAXM];11 12 char bul...
分类:
其他好文 时间:
2015-01-01 18:29:52
阅读次数:
221
Given two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.ExampleFor "ABCD" and "EDCA", the LCS is "A" (...
分类:
其他好文 时间:
2015-01-01 00:12:17
阅读次数:
122
解题思路:可以转化为求最长上升子序列来做,还是可以用an与按升序排列后的an求LCS来做,为防止超时,用滚动数组优化一下就可以了。最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others...
分类:
其他好文 时间:
2015-01-01 00:07:48
阅读次数:
211
原文:DOS批处理的字符串功能DOS批处理的字符串功能 批处理有着具有非常强大的字符串处理能力,其功能绝不低于C语言里面的字符串函数集。批处理中可实现的字符串处理功能有:截取字符串内容、替换字符串特定字段、合并字符串、扩充字符串等功能。下面对这些功能一一进行讲解。 【 1、截取字符串 】 截取字符串...
分类:
其他好文 时间:
2014-12-31 18:09:44
阅读次数:
202
addcslashes — 为字符串里面的部分字符添加反斜线转义字符addslashes — 用指定的方式对字符串里面的字符进行转义bin2hex — 将二进制数据转换成十六进制表示chop — rtrim() 的别名函数chr — 返回一个字符的ASCII码chunk_split — 按一定的字符...
分类:
Web程序 时间:
2014-12-31 11:14:15
阅读次数:
206