自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

lzs_lazy

======== 你只有非常努力,才能够看起来毫不费力!!

  • 博客(16)
  • 收藏
  • 关注

转载 中国剩余定理 【CRT 两种模型的讲解】

原理讲解很好的文章 下面模板的原文链接问题一:给你n个方程组: x%m[0] = a[0] x%m[1] = a[1] ··· x%m[n-1] = a[n-1] 求变量x 的值,其中m[]必须两两互质。 · 直接exgcd可以KOLL gcd(LL a, LL b){ return b == 0 ? a : gcd(b, a%b);}void exgcd(LL a, L

2017-09-26 20:01:44 654

原创 【西南交通大学第十三届ACM决赛-重现赛】 A B E F H K

A 时间限制:1秒 空间限制:131072K 题目描述 Today HH becomes a shopper, and he wants to buy a lot. HH has a bag that can carry at most w kilograms things in total, and he has d dollars. Now he wants to buy n i

2017-09-23 00:06:03 822

原创 【Codeforces Round #429 (Div. 2)】 A B C

A. Generous Kefa time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output One day Kefa found n baloons. For convenience, we denote color of i-th ba

2017-09-21 20:30:18 213

转载 随机数测试函数 (rand() 和srand() )

有时候如果对自己的程序不是很肯定,或者已经wa了,但是不知道哪里bug,我们可以自己造数据来测试我们的程序,这样就可能找到程序的bug,减少出错。 很明显,我们需要一种随机的数据来测试,所以就用到了随机数函数了。原文链接计算机的随机数都是由伪随机数,即是由小M多项式序列生成的,其中产生每个小序列都有一个初始值,即随机种子。(注意: 小M多项式序列的周期是65535,即每次利用一个随机种子生成的随机

2017-09-21 18:10:30 984

原创 【poj 2785】4 Values whose Sum is 0 【折半枚举】

The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the following

2017-09-20 13:11:41 215

原创 【codefores 612】 The Union of k-Segments 【思维+ 线段处理】

D. The Union of k-Segments time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given n segments on the coordinate axis Ox and the numb

2017-09-19 18:17:19 344

原创 Codeforces Round #422 (Div. 2) A B C D

A I’m bored with life time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Holidays have finished. Thanks to the help of the hacker Leha, Noor

2017-09-19 14:13:33 742

转载 递推公式 【黑科技】

有一个递推式的模板,你给的值越多(main中的x值越多),递推式得出的结果越准确 据说是杜教的模板。 可不是很会用,找了几个递推的题,尝试了一下,发现对于最后取模固定的题,还是蛮好用。如果每次取模都不一样,我找的题,都用不好。【代码好多地方看不懂 ,也不知道真 求不了,还是我不会用 TAT ,哪位dalao 可以指点下】 下面为代码#include <cstdio>#include

2017-09-14 20:03:39 651

原创 【HDU 6187 】Destroy Walls 【平面图+最大生成树】

Destroy WallsTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 287 Accepted Submission(s): 125Problem Description Long times ago, there are

2017-09-14 19:55:38 604

原创 边权更新 查询路径长度和最大边权 【树链剖分 模板】

题意 给n个点的树,有两种操作 op x y ,第一种操作,将第x条边修改权值为y,第二种操作查询x到y的路径长度。今天刚学,说下我目前的理解,树链剖分就是将树上的边按照一种序排列到线段树上,从而进行快速的查询和更新。 对树的拆分,分为轻链和重链,快速的查询多是在重链上,轻链一般还是要一个个走,所以查询的时候,多是将轻链上的点跳到重链上,从而对多个重链来处理达到查询的目的。 【ps 练

2017-09-13 23:43:01 699

原创 【2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛】 J Our Journey of Dalian Ends 【拆点费用流】

Life is a journey, and the road we travel has twists and turns, which sometimes lead us to unexpected places and unexpected people.Now our journey of Dalian ends. To be carefully considered are the fol

2017-09-12 21:25:53 295

原创 【2017 ACM-ICPC 亚洲区(乌鲁木齐赛区)网络赛 】H Skiing 【求DAG图的最长路】

In this winter holiday, Bob has a plan for skiing at the mountain resort.This ski resort has MM different ski paths and NN different flags situated at those turning points.The ii-th path from the S_iS

2017-09-12 19:25:30 455

原创 【HDU 6205】 card card card 【尺取】

card card cardTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1280 Accepted Submission(s): 574Problem Description As a fan of Doudizhu, WYJ

2017-09-12 18:13:13 235

原创 【HDU 6198】number number number 【规律+矩阵快速幂】

We define a sequence F:⋅ F0=0,F1=1; ⋅ Fn=Fn−1+Fn−2 (n≥2).Give you an integer k, if a positive number n can be expressed by n=Fa1+Fa2+…+Fak where 0≤a1≤a2≤⋯≤ak, this positive number is mjf−good. Otherw

2017-09-12 09:34:19 416

原创 【HDU 6197】array array array 【LIS】

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2917 Accepted Submission(s): 1170Problem Description One day, Kaitou Kiddo had stolen a pri

2017-09-12 08:34:38 267

原创 【HDU 6201】transaction transaction transaction 【费用流】

transaction transaction transactionTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total Submission(s): 962 Accepted Submission(s): 474Problem Description Kel

2017-09-12 08:25:16 307

空空如也

空空如也

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

TA关注的人

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