解决方法: 方法1: 使用jquery里面的全局函数$.trim()代替原生js方法trim(): $.trim( 你要替换的字符 ); 方法2: Function.prototype.method = function (name, func) { this.prototype[name] = f...
分类:
其他好文 时间:
2014-06-28 20:33:06
阅读次数:
294
NSString*cleanString=[dirtyStringstringByTrimmingCharactersInSet:[NSCharacterSetwhitespaceAndNewlineCharacterSet]];还有就是去除多于的空格,如下:NSString*theString=@...
分类:
其他好文 时间:
2014-06-28 19:56:55
阅读次数:
227
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=743题意:有两个音乐厅出租。给出n个租客,每个租客有个租的时间段[L,R],以及租费。任意时候音乐厅只能租给最多一个租客。问如何选择租给哪些租客使得赚的钱最多?思路:f[...
分类:
其他好文 时间:
2014-06-23 07:46:10
阅读次数:
265
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4255题意:n个人订餐。n个人位于一条线上,饭店也在这条线上。每个人有一个脾气值p。若第i分钟得到他预定的饭不满意度为p*i。送饭人的速度已知。求一种送饭顺序使得总不满意...
分类:
其他好文 时间:
2014-06-23 07:39:56
阅读次数:
243
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=15题意:给定一个图。判断是不是弦图?思路:(1)神马是弦图?对于一个无向图,若该图的任意一个长度大于3的环中存在一条边连接这个环上不相邻的两点,则此图称作弦图。(2)什么...
分类:
Web程序 时间:
2014-06-23 06:50:38
阅读次数:
300
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2182题意:给出一个无向图,问最少删掉多少个顶点之后图变得不连通?思路:将原图每个点拆点(i,i+n),连边,对原图的边(u,v),连边,。然后对于每对顶点(i,j)...
分类:
Web程序 时间:
2014-06-23 00:51:26
阅读次数:
291
Dynamic Rankings
Time Limit: 10 Seconds
Memory Limit: 32768 KB
The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply...
分类:
其他好文 时间:
2014-06-22 17:04:16
阅读次数:
182
使用l,r指针游动。
然后使用记录游动过程中的最大值。
我离散化了一下。
#include
#include
#include
#include
#include
#include
using namespace std;
#define maxn 110000
mapmp;
struct list
{
int x;
int get;
int lose;
in...
分类:
其他好文 时间:
2014-06-22 11:52:02
阅读次数:
226
如果不需要求边的个数的话,就是一个裸的最小割问题。
求边的个数就用边的权值记录一下。
#include
#include
#include
#include
#include
using namespace std;
#define INF 99999999
#define LL long long
const LL maxn =55;
const LL maxm =4400;
con...
分类:
其他好文 时间:
2014-06-22 11:15:00
阅读次数:
167
以下代码摘抄CSDN论坛:源文连接在:http://topic.csdn.net/u/20110620/10/1e0e91f0-1440-45db-aa29-6ce618fec2da.html本人目的只在于收藏;C方法: 1 void del_sp(char *src) // 删除C风格字符串...
分类:
编程语言 时间:
2014-06-20 16:23:36
阅读次数:
261