//字符串分割函数std::vector split(std::string str,std::string pattern){ std::string::size_type pos; std::vector result; str+=pattern;//扩展字符串以方便操作 ...
分类:
编程语言 时间:
2014-10-09 02:33:37
阅读次数:
220
在web.xml文件加入characterEncodingFilterorg.springframework.web.filter.CharacterEncodingFilterencodingGbkforceEncodingtruecharacterEncodingFilter/*这样只能对pos...
分类:
编程语言 时间:
2014-10-09 02:18:27
阅读次数:
211
UVA1513 - Movie collection
题目链接
题目大意:给你一叠DV,编号1到n,1在最上面,n在最下面。然后现在给你m个操作,每次都指定一张CD,问要拿走这个CD需要挪走上面多少张CD,并且这个要拿走的CD放在这个叠CD的顶端。
解题思路:将这些CD的上面有多少张CD用数状数组来存储,但是每次要移动的话就有点难办,所以每次移动就将这张CD的pos更新一下,将之...
分类:
其他好文 时间:
2014-10-08 12:43:55
阅读次数:
149
以下是接口xml格式数据: rss xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
channel>
title>Yahoo! Weather - Beijing, CNtitle>
lin...
分类:
编程语言 时间:
2014-10-07 17:54:03
阅读次数:
338
题意: 树上路径之间的点统一加减k,查询某点的值解法:不会LCA的解法,于是用树链剖分了,比较简单的剖分,然后用线段树维护就行了,相当于区间更新,单点查询,查询点 i 的值时,只需在线段树中查询pos[u]位置的值即可。加IO优化900+ms代码:#include #include #include...
分类:
其他好文 时间:
2014-10-07 17:16:13
阅读次数:
221
https://vijos.org/p/1629本来是想出来了的,,,,但是有个地方写挫了一直没发现,sad就是dfs的时候我传的pos传错了QAQ这题用容斥很好想首先在区间[l, r]能被a整除的数有r/a-(l-1)/a,下取整。而这题要求的是其中B是区间内能被8整除的数,Ai分别为能整除所给的...
分类:
其他好文 时间:
2014-10-07 16:59:03
阅读次数:
287
题目:点击打开链接
思路:对于当前位置的每一个时间段都要走一遍(除了那些需要的时间比最大允许的时间还大的),用 整形 vis[当前位置][剩余油量] 标记。
#include
#include
#include
#define INF 999999999
using namespace std;
struct S{
int pos,time,remain;
bool ...
分类:
其他好文 时间:
2014-10-06 12:14:40
阅读次数:
229
题目大意:动态维护第k小。
思路:线段树套treap,裸题,就是不怎么好写。
CODE:
#include
#include
#include
#include
#define MAX 50010
#define INF 1e9
#define LEFT (pos << 1)
#define RIGHT (pos << 1|1)
#define SIZE(x)...
分类:
其他好文 时间:
2014-10-02 13:03:23
阅读次数:
244
http://acm.hdu.edu.cn/showproblem.php?pid=5037
贪心 最初WA了一次,做法就是看石头间距pos[i+1]-pos[i]
1,2,3 这个例子就能破掉这种策略
所以其实一个比较重要的问题在于处理上一步到下一步的剩余问题
参考了http://blog.csdn.net/u014569598/article/details/39471913...
分类:
其他好文 时间:
2014-10-01 18:50:51
阅读次数:
175
CString类型的replaceint pos = 0;while((pos = it->m_strFile.find(_T("%UC_INSTALL_ROOT%\\"), pos)) != it->m_strFile.npos) it->m_strFile.replace(pos, _tc...
分类:
其他好文 时间:
2014-10-01 02:41:20
阅读次数:
195