上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 31 下一页
摘要: /*我尼玛 又一个min打成max 看了半天....*/ #include #include #include #define maxn 200010 #define inf 0x7fffffff using namespace std; int n,m,head[maxn],num,v[maxn],fa[maxn][25],c[maxn]; int mii[maxn][25],mxx[maxn... 阅读全文
posted @ 2016-09-17 08:25 一入OI深似海 阅读(333) 评论(1) 推荐(0) 编辑
摘要: 题目描述 在幻想乡,东风谷早苗是以高达控闻名的高中生宅巫女。某一天,早苗终于入手了最新款的钢达姆模型。作为最新的钢达姆,当然有了与以往不同的功能了,那就是它能够自动行走,厉害吧(好吧,我自重)。早苗的新模型可以按照输入的命令进行移动,命令包含’E’、’S’、’W’、’N’四种,分别对应四个不同的方向 阅读全文
posted @ 2016-09-16 20:01 一入OI深似海 阅读(286) 评论(0) 推荐(1) 编辑
摘要: 中文题目名称 祖孙询问 比赛 数字 英文题目名称 tree mat num 可执行文件名 tree mat num 输入文件名 tree.in mat.in num.in 输出文件名 tree.out mat.out num.out 每个测试点时限 1秒 1秒 1秒 测试点数目 10 10 10 每 阅读全文
posted @ 2016-09-14 19:08 一入OI深似海 阅读(732) 评论(0) 推荐(1) 编辑
摘要: 题目名称 “与” 小象涂色 行动!行动! 输入文件 and.in elephant.in move.in 输出文件 and.out elephant.in move.in 时间限制 1s 1s 1s 空间限制 64MB 128MB 128MB “与” (and.pas/.c/.cpp) 时间限制:1 阅读全文
posted @ 2016-09-13 16:40 一入OI深似海 阅读(287) 评论(0) 推荐(0) 编辑
摘要: /*Dinic*/ #include #include #include #include #define maxn 210 #define inf 0x7fffffff using namespace std; int n,m,num,head[maxn],cur[maxn],dis[maxn]; struct node{ int u,v,flow,pre; }e[maxn*2]; v... 阅读全文
posted @ 2016-09-12 16:02 一入OI深似海 阅读(209) 评论(0) 推荐(0) 编辑
摘要: /* 比较简单的置换群题 首先排成升序 每个元素都有想去的位置 先找轮换 比如1->2 2->3 3->1 那么(1.2.3)就是一个轮换 可以看出他们之间互不影响 然后开始处理每个轮换 可以用数学归纳法证明处理每个小的需要最少换n-1次 为了让代价最小我们那c最小的元素当做中间值 这里有反例 就是如果有一个c很小的数 我们先把这个轮换里的min和这个交换 然后拿这个完成n-1次 最后再换回来 ... 阅读全文
posted @ 2016-09-12 14:51 一入OI深似海 阅读(213) 评论(0) 推荐(0) 编辑
摘要: /* 线段树区间合并 维护几个信息 到时候乱搞一下就好了 开始T了 有一种情况可以不用递归 直接算出来 */ #include #include #include #define maxn 100010 #define lc (k>1) using namespace std; int n,m,a[maxn],ls[maxn*4],rs[maxn*4],ln[maxn*4],rn[maxn*4... 阅读全文
posted @ 2016-09-11 19:07 一入OI深似海 阅读(142) 评论(0) 推荐(0) 编辑
摘要: /* poj 1200 Crazy Search 字符串hash O(n)枚举起点 然后O(1)查询子串hash值 然后O(n)找不一样的个数 复杂度是线性的 */ #include #include #include #include #define P 29 #define maxn 1000010 using namespace std; int n,c,len,p[maxn],ha[... 阅读全文
posted @ 2016-09-10 11:25 一入OI深似海 阅读(299) 评论(0) 推荐(0) 编辑
摘要: /* 自己yy的奇葩做法居然A了23333 不过空间好像很大 时间好像略慢..... 毕竟不是正解 前缀维护sum值 枚举区间起点 然后终点的坐标可以确定在一个范围 可持久化线段树查询区间第1大 然后放到堆里 注意每个从堆里取出来再把这个区间第2大的放进去 这里k可能减成负的 注意特判 开始wa了 还有开longlong */ #include #include #include #incl... 阅读全文
posted @ 2016-09-10 07:56 一入OI深似海 阅读(285) 评论(0) 推荐(0) 编辑
摘要: /* 我尼玛这题不想说啥了 亏了高精写的熟..... 加减乘除max都写了 高精二分 */ #include #include #include #define maxn 1010 #define memcpy(a,b); for(int i=0;i9){c[i+1]++;c[i]%=10;} if(c[L+1])L++;c[0]=L; memcpy(a,c); } void ... 阅读全文
posted @ 2016-09-09 11:29 一入OI深似海 阅读(325) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 31 下一页