- 博客(271)
- 收藏
- 关注
原创 【杂记】OI之旅大事记
2018.7.22 AC第一道紫题2018.8.17 博客100篇2018.8.21 洛谷橙名2018.8.24 博客200篇,AC新手村2018.8.29 一共AC700题,提交500祭2018.9.01 神牛,博客300篇2018.9.03 洛谷红名祭2018.9.04 洛谷AC2002018.9.06 第一次做黑题、国家集训队、清华集训2018.9.07 ...
2018-09-17 09:23:39 391
原创 OI每周刷题记录——lrllrl
看这标题就知道我是模仿的hzwer大佬,远程%%% 大佬的OI经历让蒟蒻我深受感触,为了晚一些AFO本蒟蒻也得加油了 从高二上期第一周开始计数,每个星期天更一次,一直更到我AFO2018.9.2~2018.9.8线段树: CH4301 线段树 poj2482(同洛谷P1502) 线段树+离散化+扫描线 CH4302 线段树+最大公约数+树状数组+构造 poj2481 线...
2018-09-16 17:11:34 1719 6
原创 【题解】洛谷U38098[NOIP2018原创模拟赛DAY1T3]PION贪吃蛇 模拟
题目链接题目背景NOIP2018原创模拟题 T3NOIP DAY1 T3 or DAY 2 T2 难度贪吃蛇大家都玩过吧,当然不同版本有不同规则。下面介绍PION贪吃蛇。注意:测试点#4,#5错误已修改,感谢:@EnTaroTassadar,@天道题目描述表示方法:该题中贪吃蛇存在于一个 nnn 行 mmm 列的矩形中,用 ‘.’ 表示空地,用 '#’ 表示蛇身,用 ‘@’表示蛇...
2018-09-30 21:08:20 462
原创 【题解】codeforces1047D[Codeforces Round #511 (Div. 2)]D.Little C Loves 3 II 数学知识
题目链接DescriptionLittle C loves number «3» very much. He loves all things about it.Now he is playing a game on a chessboard of size n×m. The cell in the x-th row and in the y-th column is called (x,y...
2018-09-30 15:42:13 347
原创 【题解】codeforces1047C[Codeforces Round #511 (Div. 2)]C.Enlarge GCD 最大公约数
DescriptionMr. F has n positive integers, a1,a2,…,an.He thinks the greatest common divisor of these integers is too small. So he wants to enlarge it by removing some of the integers.But this proble...
2018-09-30 15:01:56 243
原创 【题解】codeforces1047B[Codeforces Round #511 (Div. 2)]B.Cover Points 数学知识
题目链接DescriptionThere are nnn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x_1,y_1),(x_2,y_2),…,(x_n,y_n)(x1,y1),(x2,y2),…,(xn,yn).You need to place an isosceles triangle with two sides on t...
2018-09-30 13:56:57 195
原创 【题解】codeforces1047A[Codeforces Round #511 (Div. 2)]A.Little C Loves 3 I 数学知识
题目链接DescriptionLittle C loves number «3» very much. He loves all things about it.Now he has a positive integer n. He wants to split n into 3 positive integers a,b,c, such that a+b+c=n and none of t...
2018-09-30 13:44:43 200
原创 【比赛报告】 AHSOFNU codeforces训练赛2 by hzwer NOIP练习赛卷五
比赛链接A.Stadium and Games题目链接DescriptionDaniel is organizing a football tournament. He has come up with the following tournament format:In the first several (possibly zero) stages, while the number...
2018-09-30 10:25:03 234
转载 【题解】codeforces293B[AHSOFNU codeforces训练赛2 by hzwer]D.Distinct Paths dfs+剪枝+位运算
题目链接DescriptionYou have a rectangular n × m-cell board. Some cells are already painted some of k colors. You need to paint each uncolored cell one of the k colors so that any path from the upper lef...
2018-09-30 10:10:46 172
原创 【题解】codeforces293A[AHSOFNU codeforces训练赛2 by hzwer]C.Weird Game 博弈论
题目链接DescriptionYaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn’t show up, Yaroslav and Andrey play another game.Roman leaves a word for...
2018-09-30 08:17:39 317
原创 【题解】poj3171 Cleaning Shifts 线段树优化DP
题目链接DescriptionFarmer John’s cows, pampered since birth, have reached new heights of fastidiousness. They now require their barn to be immaculate. Farmer John, the most obliging of farmers, has no c...
2018-09-29 18:10:41 486
转载 【题解】codeforces235A[AHSOFNU codeforces训练赛2 by hzwer]B.LCM Challenge 数学知识
题目链接DescriptionSome days ago, I learned the concept of LCM (least common multiple). I’ve played with it for several times and I want to make a big number with it.But I also don’t want to use many n...
2018-09-29 17:26:33 214
原创 【题解】codeforces325B[AHSOFNU codeforces训练赛2 by hzwer]A.Stadium and Games 枚举+二分
题目链接DescriptionDaniel is organizing a football tournament. He has come up with the following tournament format:In the first several (possibly zero) stages, while the number of teams is even, they s...
2018-09-29 17:02:57 212
原创 【题解】CH5702 Count The Repetitions 倍增优化DP
题目链接描述定义 conn(s,n)conn(s,n)conn(s,n) 为 nnn 个字符串 sss 首尾相接形成的字符串,例如:conn(“abc”,2)="abcabc称字符串 aaa 能由字符串 bbb 生成,当且仅当从字符串 bbb 中删除某些字符后可以得到字符串 aaa。例如“abdbec”可以生成“abc”,但是“acbbe”不能生成“abc”。给定两个字符串 s1s_1s...
2018-09-28 23:00:28 406
原创 【题解】poj2411 Mondriaan's Dream 状压DP
题目链接DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his ‘toilet series’ (where he had to use his toilet paper to draw...
2018-09-28 21:16:01 259
原创 【题解】codeforces24D Broken robot 期望DP+高斯消元+后效性处理
题目链接DescriptionYou received as a gift a very clever robot walking on a rectangular board. Unfortunately, you understood that it is broken and behaves rather strangely (randomly). The board consists ...
2018-09-28 20:24:59 367
原创 【题解】CH5501 环路运输 单调队列+环形处理
题目链接描述在一条环形公路旁均匀地分布着N座仓库,编号为1~N,编号为 i 的仓库与编号为 j 的仓库之间的距离定义为 dist(i,j)=min(|i-j|,N-|i-j|),也就是逆时针或顺时针从 i 到 j 中较近的一种。每座仓库都存有货物,其中编号为 i 的仓库库存量为 A_i。在 i 和 j 两座仓库之间运送货物需要的代价为 A_i+A_j+dist(i,j)。求在哪两座仓库之间运...
2018-09-28 17:05:53 705
原创 【题解】poj2228 Naptime 线性DP+环形处理
题目链接DescriptionGoneril is a very sleep-deprived cow. Her day is partitioned into N (3 <= N <= 3,830) equal time periods but she can spend only B (2 <= B < N) not necessarily contiguous p...
2018-09-28 16:04:05 567
原创 【题解】poj3585 Accumulation Degree 二次扫描与换根法
题目链接DescriptionTrees are an important component of the natural landscape because of their prevention of erosion and the provision of a specific ather-sheltered ecosystem in and under their foliage. ...
2018-09-28 15:30:23 316
原创 【题解】CH5402 选课 背包类树形DP
题目链接描述学校实行学分制。每门的必修课都有固定的学分,同时还必须获得相应的选修课程学分。学校开设了 N(N≤300) 门的选修课程,每个学生可选课程的数量 M 是给定的。学生选修了这 M 门课并考核通过就能获得相应的学分。在选修课程中,有些课程可以直接选修,有些课程需要一定的基础知识,必须在选了其他的一些课程的基础上才能选修。例如《Windows程序设计》必须在选修了《Windows操作基...
2018-09-28 10:25:14 245
原创 【题解】CH5401 没有上司的舞会 树形DP
题目链接描述Ural大学有 NNN 名职员,编号为 1∼N1\sim N1∼N。他们的关系就像一棵以校长为根的树,父节点就是子节点的直接上司。每个职员有一个快乐指数,用整数 HiH_iHi 给出,其中 1≤i≤N1≤i≤N1≤i≤N。现在要召开一场周年庆宴会,不过,没有职员愿意和直接上司一起参会。在满足这个条件的前提下,主办方希望邀请一部分职员参会,使得所有参会职员的快乐指数总和最大,求这个...
2018-09-28 09:51:53 336
原创 【题解】CH5302 金字塔 区间DP+记忆化搜索
题目链接描述虽然探索金字塔是极其老套的剧情,但是有一队探险家还是到了某金字塔脚下。经过多年的研究,科学家对这座金字塔的内部结构已经有所了解。首先,金字塔由若干房间组成,房间之间连有通道。如果把房间看作节点,通道看作边的话,整个金字塔呈现一个有根树结构,节点的子树之间有序,金字塔有唯一的一个入口通向树根。并且,每个房间的墙壁都涂有若干种颜色的一种。探险队员打算进一步了解金字塔的结构,为此,他们...
2018-09-28 08:51:29 490
原创 【比赛报告】 Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) NOIP练习赛卷四
比赛链接A.In Search of an Easy ProblemDescriptionWhen preparing a tournament, Codeforces coordinators try treir best to make the first problem as easy as possible. This time the coordinator had chosen ...
2018-09-27 21:46:10 305
原创 【题解】codeforces1058A[Codeforces Round #512 Div.2]A.In Search of an Easy Problem 模拟
DescriptionWhen preparing a tournament, Codeforces coordinators try treir best to make the first problem as easy as possible. This time the coordinator had chosen some problem and asked n people abou...
2018-09-27 21:36:33 293
转载 【题解】codeforces1058G[Codeforces Round #512 Div.2]G.Linear Congruential Generator LCM+数学知识
DescriptionYou are given a tuple generator f(k)=(f1(k),f2(k),⋯&amp;ThinSpace;,fn(k))f^{(k)}=(f^{(k)}_1,f^{(k)}_2,\cdots,f^{(k)}_n)f(k)=(f1(k),f2(k),⋯,fn(k)), where fi(k)=(ai⋅fi(k−1)+bi)mod&amp;Thi...
2018-09-27 21:27:57 434
原创 【比赛报告】AHSOFNU codeforces训练赛1 by hzwer NOIP练习赛卷三
比赛链接A.The Game Of ParityDescriptionThere are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play the following game: in one single move, a player chooses a cert...
2018-09-27 20:17:35 183
原创 【题解】codeforces528B[AHSOFNU codeforces训练赛1 by hzwer]D.Clique Problem 排序
DescriptionThe clique problem is one of the most well-known NP-complete problems. Under some simplification it can be formulated as follows. Consider an undirected graph G. It is required to find a s...
2018-09-27 19:13:27 212
原创 【题解】codeforces528A[AHSOFNU codeforces训练赛1 by hzwer]C.Glass Carving set
题目链接DescriptionLeonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm × h mm sheet of glass, a diamond glass cutt...
2018-09-27 17:12:35 245
原创 【题解】codeforces549G[AHSOFNU codeforces训练赛1 by hzwer]B.Happy Line 排序
题目链接DescriptionDo you like summer? Residents of Berland do. They especially love eating ice cream in the hot summer. So this summer day a large queue of n Berland residents lined up in front of the ...
2018-09-27 16:34:25 247
原创 【题解】codeforces549C[AHSOFNU codeforces训练赛1 by hzwer]A.The Game Of Parity 博弈论
DescriptionThere are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play the following game: in one single move, a player chooses a certain town and burns it to t...
2018-09-27 15:49:39 200
转载 【题解】codeforces1058F[ Codeforces Round #512 Div.2]F.Putting Boxes Together 树状数组+二分
题目链接DescriptionThere is an infinite line consisting of cells. There are n boxes in some cells of this line. The ithi_{th}ith box stands in the cell aia_iai and has weight wiw_iwi. All aia_iai ar...
2018-09-27 12:01:14 344
原创 【题解】codeforces1058E[Codeforces Round #512 Div.2 E]E.Vasya and Good Sequences 位运算
DescriptionVasya has a sequence a consisting of nnn integers a1,a2,⋯&amp;ThinSpace;,ana_1,a_2,\cdots,a_na1,a2,⋯,an. Vasya may pefrom the following operation: choose some number from the sequence a...
2018-09-27 09:41:26 327
原创 【题解】codeforces1058D[Codeforces Round #512 D]D.Vasya and Triangle 最大公约数
题目链接DescriptionVasya has got three integers nnn, mmm and kkk. He’d like to find three integer points (x1,y1)(x_1,y_1)(x1,y1), (x2,y2)(x_2,y_2)(x2,y2), (x3,y3)(x_3,y_3)(x3,y3), such that 0≤x1,x...
2018-09-26 23:15:39 360
原创 【题解】codeforces1058C[Codeforces Round #512 Div.2 C]C.Vasya and Golden Ticket 区间DP
DescriptionRecently Vasya found a golden ticket — a sequence which consists of nnn digits a1a2⋯an‾\overline{a_1a_2\cdots a_n}a1a2⋯an. Vasya considers a ticket to be lucky if it can be divided int...
2018-09-26 22:27:10 277 2
原创 【题解】codeforces1058B[Codeforces Round #512 Div.2 B]B.Vasya and Cornfield 数学知识
DescriptionVasya owns a cornfield which can be defined with two integers n and d. The cornfield can be represented as rectangle with vertices having Cartesian coordinates (0,d),(d,0),(n,n−d) and (n−d...
2018-09-26 20:52:36 269
原创 【模板】洛谷P3368树状数组2
题目链接题目描述如题,已知一个数列,你需要进行下面两种操作:1.将某区间每一个数数加上x2.求出某一个数的值输入输出格式输入格式:第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含2或4个整数,表示一个操作,具体如下:操作1: 格式:1 x y k 含义:将区间[x,y]内每...
2018-09-26 19:14:36 172
原创 【题解】洛谷P4342(poj1179)[IOI1998]Polygon 区间DP
题目链接题意翻译题目可能有些许修改,但大意一致多边形是一个玩家在一个有 nnn 个顶点的多边形上的游戏,如图所示,其中 n=4n=4n=4 。每个顶点用整数标记,每个边用符号 +++(加)或符号 ∗*∗(乘积)标记。第一步,删除其中一条边。随后每一步:选择一条边连接的两个顶点 V1V1V1 和 V2V2V2,用边上的运算符计算 V1V1V1 和 V2V2V2 得到的结果来替换这两个顶点。...
2018-09-26 17:25:11 263
原创 【题解】CH5301石子合并 区间DP
描述设有N堆沙子排成一排,其编号为1,2,3,…,N(N<=300)。每堆沙子有一定的数量,可以用一个整数来描述,现在要将这N堆沙子合并成为一堆,每次只能合并相邻的两堆,合并的代价为这两堆沙子的数量之和,合并后与这两堆沙子相邻的沙子将和新堆相邻,合并时由于选择的顺序不同,合并的总代价也不相同,如有4堆沙子分别为 1 3 5 2 我们可以先合并1、2堆,代价为4,得到4 5 2 又合并...
2018-09-26 11:46:55 231
原创 【题解】poj1742 Coins 多重背包+贪心
题目链接DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3…An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice w...
2018-09-26 08:12:48 259
原创 2018.9.16~201.9.22一周工作总结
题目完成情况dfs序poj3321 Apple Tree dfs序+树状数组数论LightOJ1236 Pairs Forming LCM 唯一分解定理+线性筛LightOJ1245 Harmonic Number (II) 数学知识LightOJ1259 Goldbach`s Conjecture 线性筛LightOJ1278 Sum of Consecutive Integers...
2018-09-25 23:16:14 192
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人