随笔分类 - 数据结构--STL
摘要:题目 分析 又不会做。。。。。。。 显然很好想到前缀和处理一下。 然后考虑最大化结果,直接上st表。 问题来了,然后呢? 怎么做$ length \in [l,r] $ 呢? 正解是设一个五元组 (i,l,r,val,pos) 。 i是左端点,l,r是右端点范围,val是 i 到 pos的和, po
阅读全文
摘要:题目 题目 分析 写了个平淡无奇的栈处理表达式,在WA了5发后发现,我没处理空串,,,,(或者说鲁棒性差? 代码 cpp include using namespace std; bool equal(char a,char b) { if((
阅读全文
摘要:题目 题目 分析 第一次用stringstream,真TMD的好用 代码 cpp include using namespace std; int main() { int n; cin n; getchar();//回车 while(n )
阅读全文
摘要:题目 题目 分析 练习STL 代码 cpp include using namespace std; int main() { int n; while(scanf("%d",&n) && n!=0) { queue q; printf("Di
阅读全文
摘要:题目 题目 分析 自认已经很简洁了,虽说牺牲了一些效率 代码 cpp include using namespace std; set m; string s[120003]; int main() { int n; while(cin s[n
阅读全文
摘要:题目 题目 分析 练习STL 代码 cpp include using namespace std; int main() { int t; scanf("%d",&t); while(t ) { int n,m,a[105],cnt=0; q
阅读全文

浙公网安备 33010602011771号