![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
POJ
QiHang_QiHang
这个作者很懒,什么都没留下…
展开
-
POJ1159求LCS长度 滚动数组优化空间
Memory Limit: 65536K Total Submissions: 9042 Accepted: 3864 Special Judge Description In a few months the European Currency Union will原创 2017-11-09 19:37:11 · 477 阅读 · 0 评论 -
POJ3522 SlimSpan 最大边和最小边的差最小的生成树
Slim Span Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7870 Accepted: 4191 Description Given an undirected weighted graph G, you should find one of span原创 2017-11-14 21:07:47 · 297 阅读 · 0 评论 -
排列组合计数&POJ306
题意: 计算C = N! / (N-M)!M! 方法一: #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; LL s原创 2017-12-04 11:07:13 · 240 阅读 · 0 评论 -
POJ3468线段树区间修改模板题
题意n个数m个操作1~n的值两种操作:“Q a b ”查询区间[a,b]值的和“C c a b”区间[a,b]每个值加c输出每次查询的值代码#include <iostream> #include <stdlib.h> #include <stdio.h> #include <algorithm> #include <math.h&g...原创 2018-06-06 19:58:41 · 194 阅读 · 0 评论 -
POJ1185(状压DP)
题意 中文题。 题解 首先考虑每一行(横向)的影响,每个战队战火波及范围是两格,所以保证(state & state<<1)和(state & state<<2)都要为0。 并且每行中最多的状态不是1<<10,正因为战火会影响两格,所以一行的状态最多不超过60。所以可以预处理出每行可行的状态。 再考虑列的情况,第i行只会影响到第i-1行...原创 2018-07-28 16:12:14 · 478 阅读 · 0 评论 -
POJ2104求区间第K大(主席树)
#include <iostream> #include <stdlib.h> #include <stdio.h> #include <algorithm> #include <math.h> #include <map> #include <vector> #include <string.h&原创 2018-07-21 17:29:17 · 221 阅读 · 0 评论 -
POJ2823(单调队列,二分出队列)
题意 给你n个数和一个区间的长度k,求从前往后每个[i,i+k-1] (1<=i<=n-k+1)区间的最大值和最小值。 题解 用单调队列搞一搞,然后。。。然后就超时了,学习了一下可以二分出队列,就去弄了一下二分(其实k不大的话二分也没啥用啊)。然后。。。然后就超时了。 好吧为什么G++就是会超时呢?用C++就过了。 代码 #include<cstdio> #i...原创 2018-07-31 17:07:30 · 474 阅读 · 0 评论 -
POJ3254(状压DP)
题意 给你一个n*m的矩阵(农田),1表示可以种植,0表示不能种植。且上下和左右每个单元不能相邻。问有多少种种植方法(可以不种植)。 样例 Sample Input 2 3 1 1 1 0 1 0 Sample Output 9 1 2 3 0 4 0 种植一棵树(1,2,3,4)4种,两棵(13,14,34)3种,三棵(134)1种,零棵树1种,sum = 4+3+1+1 ...原创 2018-07-28 11:35:39 · 306 阅读 · 0 评论 -
POJ2096(概率DP基础)
题意 一个软件有s个子系统,这个软件会产生n种bug。 某人一天发现一个bug,这个bug属于n种bug中的某种bug,发生在某个子系统中。 求找到所有的n种bug,且每个子系统都找到bug,这样所要的天数的期望。 题解 找到某种bug的概率是1/n,属于某个子系统的概率是1/s。 设dp[i][j]是找到了i种bug,存在于j个子系统中,此状态下达到目标天数的期望。 dp[...原创 2018-08-13 10:35:55 · 334 阅读 · 0 评论