自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(138)
  • 收藏
  • 关注

原创 sum log算组合数

double calc(int n, int m) { return exp(sum[n] - sum[m] - sum[n - m]);}int main() { for(int i = 1; i < N; i++) sum[i] = sum[i - 1] + log(i); cout<<calc(4, 2)<<endl; r...

2019-08-04 11:14:51 442

原创 codeforces Round 572 F. Array Beauty

https://www.luogu.org/problemnew/solution/CF1188Chttps://blog.csdn.net/huayunhualuo/article/details/95616635更正一下第二篇dp[index][len] ,前index个数长度为len的子序列的个数。关键是得想明白差分 哈哈C. Array Beauty...

2019-07-20 15:09:40 191

转载 Codeforces Round #511 (Div. 1) C. Region Separation(dp + 数论)

转自:https://www.cnblogs.com/zjp-shadow/p/9773420.html这个代码太6了#include &lt;bits/stdc++.h&gt;#define For(i, l, r) for(register int i = (l), i##end = (int)(r); i &lt;= i##end; ++i)#define Fordown(i...

2019-03-07 12:06:28 336

原创 Codeforces 1034A. Enlarge GCD?????????????????

正常程序#include&lt;bits/stdc++.h&gt;using namespace std;const int MAXN = 1.5e7+5;const int INF = MAXN+100;int n, cnt, maxx, answer;int a[300005];bool isPrime[MAXN+100];int GCD;int eqNum[MAXN...

2019-03-06 00:26:30 233

原创 codeforces #499 (Div. 1) 1010E. Store[二维线段树]

(转)(改编)自https://blog.csdn.net/effervescence/article/details/81236076E. Storetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNa...

2019-03-05 21:14:20 269

原创 codeforces 1010 C. Border Bézout's identity

C. Bordertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAstronaut Natasha arrived on Mars. She knows that the Martians are very ...

2019-03-01 06:29:05 180

原创 Codeforces 983E NN country 倍增 树状数组

http://codeforces.com/contest/983/problem/E E. NN countrytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the NN country, ...

2019-02-14 06:10:05 284

翻译 Codeforces 983D Arkady and Rectangles 扫描线?

这篇文章写得挺好:https://blog.csdn.net/Tiw_Air_Op1721/article/details/84038246但是关于mn的作用没写全-。-D. Arkady and Rectanglestime limit per test4 secondsmemory limit per test256 megabytesinputstandard...

2019-02-09 07:13:06 209

转载 Virtual Memory | 虚拟内存

通过上一篇文章的扯淡,我们应该已经明白了存储器的层次结构,技术细节很复杂,但是思想却不难理解,因为就是很简单的缓存思想。那么本文我们开始讨论关于内存的另一个话题.虚拟内存。其实思想也是很容易理解的。我不知道有多少人听过虚拟内存这个概念,但是虚拟内存是计算机系统最重要的概念之一,并且它成功的主要原因就是它一直在沉默的,自动的工作,换句话说,我们这些做应用的程序员根本不需要干涉它的工作过程,但是一个...

2018-10-18 15:17:49 845

原创 OS Class, Thread 笔记

  

2018-09-27 15:33:10 165

转载 BZOJ 3436: 小K的农场 差分约束

按照惯例,先搬一下qsc的,主要是自己太懒,更是他的格式太好看了!!!!https://www.cnblogs.com/qscqesze/p/4776586.html3436: 小K的农场Time Limit: 1 Sec  Memory Limit: 256 MB题目连接http://www.lydsy.com/JudgeOnline/problem.php?id=34...

2018-09-22 01:31:36 135

原创 再探二分 Codeforces Round #379 (Div. 2) C. Anton and Making Potions 枚举+二分

 FROM QSChttps://www.cnblogs.com/qscqesze/p/6069216.html C. Anton and Making Potions题目连接:http://codeforces.com/contest/734/problem/CDescriptionAnton is playing a very interesting comput...

2018-09-21 17:48:00 128

原创 POJ2001 Shortest Prefixes 字典树

 Shortest PrefixesTime Limit: 1000MS   Memory Limit: 30000K Total Submissions: 21761   Accepted: 9320 DescriptionA prefix of a string is a substring starting at the beginning of ...

2018-09-21 13:56:57 118

原创 HDU 2072 单词数 Trie 如何debug一颗Trie

单词数Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 66379    Accepted Submission(s): 16707 Problem Descriptionlily的好朋友xiaoou333最近很空,他想了一件没...

2018-09-21 12:59:17 144

原创 HDU 1251 统计难题 Trie/字典树模版题

统计难题Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 57839    Accepted Submission(s): 20214 Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多...

2018-09-21 12:22:05 126

转载 Codeforces Round #304 (Div. 2) D. Soldier and Number Game 数学 一个数最大可分成多少质因数

惯例抄qsc,不解释了。。。https://www.cnblogs.com/qscqesze/p/4523625.htmlD. Soldier and Number GameTime Limit: 20 Sec  Memory Limit: 256 MB题目连接http://codeforces.com/contest/546/problem/DDescriptionTw...

2018-09-20 04:49:26 131

转载 BZOJ 2818: Gcd 欧拉函数

继续复制QSC  https://www.cnblogs.com/qscqesze/p/5403692.htmlBZOJ 2818: Gcd 筛法 2818: Gcd题目连接:http://www.lydsy.com/JudgeOnline/problem.php?id=2818Description给定整数N,求1&lt;=x,y&lt;=N且Gcd(x,y)为素数...

2018-09-20 04:16:24 117

转载 BZOJ 2190: [SDOI2008]仪仗队 欧拉函数

按照近几天惯例,偷一波QSC的。https://www.cnblogs.com/qscqesze/p/4365793.html 2190: [SDOI2008]仪仗队Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 1405  Solved: 901题目连接http://www.lydsy.com/JudgeOnline/probl...

2018-09-20 03:48:14 102

转载 IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) E. Bear and Forgotten Tree 2 bfs set 反图的生成树 快速连通块

老规矩,抄一波QSC,自己的写在后面 E. Bear and Forgotten Tree 2题目连接:http://www.codeforces.com/contest/653/problem/EDescriptionA tree is a connected undirected graph consisting of n vertices and n  -  1 e...

2018-09-20 03:42:09 158

原创 set 挖坑

#include&lt;bits/stdc++.h&gt;using namespace std;set&lt;int&gt; S;int main(){ for (int i=1; i&lt;=100; i++){ S.insert(i); } int cnt = 100; for (set&lt;int&gt;::iterator it = S.begin(); S.siz...

2018-09-20 03:33:56 103

转载 Codeforces 786B Legacy 最短路+线段树

不错的题目,这次不偷qsc得了,偷个别人的https://blog.csdn.net/diogenes_/article/details/80396914传送门 题目意思很简单,就是你有三种操作: 1 u v w 从u向v连一条权值为w的有向边 2 u L R w 从u向L至R的所有结点连一条权值为w的有向边 3 u L R w 从L至R的所有结点向u连一条权值为w的有向边 首...

2018-09-19 12:37:45 134

原创 Codeforces Round #346 (Div. 2) F. Polycarp and Hay 并查集 bfs

老规矩,先抄一波qsc的,自己的写在后面https://www.cnblogs.com/qscqesze/p/5342366.html F. Polycarp and Hay题目连接:http://www.codeforces.com/contest/659/problem/FDescriptionThe farmer Polycarp has a warehouse w...

2018-09-19 09:38:45 121

原创 再谈Codeforces Round #443 (Div. 1) C. Tournament

今天看到qsc写过这个 转一下 再研究一下 https://www.cnblogs.com/qscqesze/p/7762484.html  C. Tournamentlinkhttp://codeforces.com/contest/878/problem/CdescriptionRecently a tournament in k kinds of sports ...

2018-09-18 02:36:37 140

原创 洛谷 P2868 观光奶牛Sightseeing Cows 01分数规划 + 最短路判负环

按照惯例,不想写题目大意,转一个https://blog.csdn.net/liangzihao1/article/details/79716799题目描述Farmer John has decided to reward his cows for their hard work by taking them on a tour of the big city! The cows m...

2018-09-17 10:43:50 251

转载 网络流四·最小路径覆盖

转自:https://blog.csdn.net/tramp_1/article/details/52742572H市一共有N个旅游景点(编号1..N),由M条单向游览路线连接。在一个景点游览完后,可以顺着游览线路前往下一个景点。为了避免游客重复游览同一个景点,游览线路保证是没有环路的。每一个调查团可以从任意一个景点出发,沿着计划好的游览线路依次调查,到达终点后再返回。每个景点只会有一...

2018-09-17 04:44:57 327

转载 BZOJ 2150: 部落战争 最大流

BZOJ 2150: 部落战争 最大流转自:https://www.cnblogs.com/qscqesze/p/4792682.html2150: 部落战争Time Limit: 1 Sec  Memory Limit: 256 MB题目连接http://www.lydsy.com/JudgeOnline/problem.php?id=2150Description...

2018-09-17 03:27:05 167

原创 get_id 在搜索时的写法

这种哈希方法很不错int get_id(int x,int y,int z){ if(M[x][y][z])return M[x][y][z]; else return M[x][y][z]=tot++;}

2018-09-17 03:08:33 434

原创 Codeforces 38G Queue Splay

题目介绍之类的 不想打字了 转一下吧:https://blog.csdn.net/acmmmm/article/details/38647791题目链接:点击打开链接题意:给定n个人来排队每个人有2个参数,身份优先级和脸皮厚度 ==来的那个人会排到队尾如果这个人的优先级比他前面那个人的优先级大就会和前面那个人交换位置。交换一次脸皮厚度减1, 一直交换到队头或者脸皮...

2018-09-14 09:48:30 128

转载 Codeforces 675D Tree Construction (splay)

转自:https://blog.csdn.net/dreamon3/article/details/51436043题意往一个根为a[0]的二叉搜索树里面插数,每插一个数就输出他的父节点。思路根据二叉搜索树的性质,我们插进去一个数,他的父节点肯定是比他小的最大的和比他大的最小的数里面的两个,然后这两个节点找最深的那个就是他的父节点,我们可以给这些节点设置一个时间戳就能判断先后顺序...

2018-09-13 05:02:50 130

原创 树链剖分 更新中

首先贴一个别人的动态开点模板树链剖分详解#include&lt;iostream&gt;#include&lt;cstdio&gt;using namespace std;const int maxn=1e5+10;struct edge{ int next,to;}e[2*maxn];struct Node{ int sum,lazy,l,r,ls,rs;...

2018-09-06 22:42:17 116

转载 【CF908E】New Year and Entity Enumeration

https://www.cnblogs.com/CQzhangyu/p/8227408.htmlhttp://www.mamicode.com/info-detail-2146477.html题意:给定M=2m−1M=2m−1,我们称一个集合S是好的,当且仅当它满足:1.∀a∈S,a xor M∈S∀a∈S,a xor M∈S,2.∀a,b∈S,a and b∈S∀a,b∈S,a and...

2018-09-05 11:19:34 210

转载 分层图

【分层图/ 变形最短路】2018 ACM-ICPC 南京网络赛 - L - Magical Girl Haze【分层图】分层图学习笔记BZOJ 26622662: [BeiJing wc2012]冻结Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 999  Solved: 535[Submit][Status][Discuss]...

2018-09-05 08:50:29 724

转载 codeforces 1037E-Trips 【拓扑序与set的结合】

http://www.cnblogs.com/wa007/p/9578320.html题目:戳这里题意:n个点,每天早上会在这n个点中加一条边,每天晚上最大的子图满足子图中每个点都有k条或以上的边。STL的强大不得不服,应该还有更优的做法 倒着查询,刚开始把所有边和点都考虑在内,之后依次从后往前删边,然后删除不符条件的点 重点在于如何删除不符合条件的点,我用set&l...

2018-09-05 08:38:01 362

转载 正确使用stl map的erase方法

http://www.cppblog.com/abware/archive/2009/01/22/72459.htmlSTL的map表里有一个erase方法用来从一个map中删除掉指令的节点eg:map&lt;string,string&gt; mapTest;typedef map&lt;string,string&gt;::iterator ITER;ITER iter=ma...

2018-09-05 08:04:57 370

原创 Codeforces 1027C. Minimum Value Rectangle

https://blog.csdn.net/qq_40727946/article/details/81841865C. Minimum Value Rectangle题目链接time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstan...

2018-09-05 05:07:27 122

原创 codeforces 915C Permute Digits (枚举)

https://blog.csdn.net/zuzhiang/article/details/79076522传送门:Permute Digits 题目大意:给你两个数 a和 b,可以打乱 a每位数的顺序,让你求满足 &lt;=b 的最大值。保证结果一定存在。 思路:由于结果一定存在,只有 b 的位数大于或等于 a 两种情况,如果 b 的位数大于 a 时,将 a 的每...

2018-09-04 21:22:59 181

转载 b的模mod逆元 = b ^ (m-2)

 http://blog.csdn.net/mys_c_k/article/details/78935830除法取模逆元,扩展欧几里得,费马小定理[数学]三、费马小定理假如p是质数,且gcd(a,p)=1,那么 a(p-1)≡1(mod p)如果求解 a / b mod m 求 b 的模m乘法逆元,若b , m互质则 k* b mod m = 1 且 b ^ (m-1) m...

2018-09-04 20:07:57 1184

转载 Good Bye 2017 D.New Year and Arbitrary Arrangement - 数学

http://www.voidcn.com/article/p-qeitlhhb-bro.html无穷概率的题目 但是有两个概率 p 和 q 且 p = 1-q,利用等比数列性质,可以计算

2018-09-04 20:04:03 91

原创 stl priority_queue 运算符重载

struct PII1{ int l, r; friend bool operator &lt; (PII1 a, PII1 b){ return a.l&gt;b.l; }};struct PII2{ int l, r; friend bool operator &lt; (PII2 a, PII2 b){ return a.r&lt;b.r; }};struct ...

2018-08-31 17:36:26 209

原创 POJ1459 Power Network Dinic最大流当前弧优化

参考:https://blog.csdn.net/Floatiy/article/details/80961870Power NetworkTime Limit: 2000MS   Memory Limit: 32768K Total Submissions:30761   Accepted: 15835 DescriptionA power netwo...

2018-08-31 09:07:27 141

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除