自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 日记(周中)

    刷了点cf的数学专题的几道题,并且昨晚打了一下cf,昨晚的题,难度不是以前那么平滑的递增的,当昨晚A,后面很少有人出题,过了很久,才陆续出题,并且C题,我第一眼树状数组,数据范围都没看就交了(因为看到B没做出了的,C过了10多个了),这样就肯定错了,最后还是ly大佬教会了我,要不然就gg了。   学习了一下分块暴力打表法。感觉这种暴力方法,对于很多答案,变量是连续求解的是可以分块的,但是,...

2018-06-28 19:04:48 126

原创 bzoj 3758(分块打表+二进制背包优化)

一直想要学习分块,这次看了点分块打表的题。感觉这题,比较经典,存下来。#include<bits/stdc++.h>using namespace std;const int block=1000000;const int table[]={0,376413,832547,1288828,1744956,2196800,2647716,3090920,3526440,39...

2018-06-25 15:45:55 244

原创 数论模板

筛素数void init() //nlogn{ memset(su,0,sizeof(su)); su[1]=1; for(int i=2;i<=n;i++) for(int j=i*2;j<=n;j+=i) su[j]=1;}void init1() //优化{ memset(su,0,sizeof(su))...

2018-06-24 21:37:19 237

原创 日记(周末)

   除了学习专题。水了牛客网的比赛,果然还是没有中T恤。   昨晚还打了cf,昨晚的题目相对简单,简单二分,简单贪心,都在C,D题的位置,E题是个组合数学+dfs暴力。最后我的dfs竟然写的姿势不对,幸亏有大佬lsd,最终也是涨分了。   这几天的cf虽然有的没及时打,赛后也补了些题,这几天数学题居多,相对组合数学的题目多点,对组合数学,求一些数的排列,包含重复数或者某个数不能在什么位置的题目,...

2018-06-24 21:18:04 105

原创 日记(周中)

      端午休息和处理杂务之后,主要就是做了区间数据维护的题目。并且把做过的题在博客上整理了一下。但是,还是有些题,没有整理,需要放到以后整理。      发现,整理题目还是要按照以前的整理方法。做过某道题一段时间再整理。这样需要再读一遍这道题。对这类题型印象更深刻。直接写博客,虽然整理的比较快,但是,对这种题型可能有些细节没有注意。      这种区间处理的题目,明显比dp要简单一点,原来的...

2018-06-21 20:48:29 117

原创 Permutation (树状数组)

Given N and K find the N-th permutation of the integers from 1 to K when those permutations arelexicographically ordered. N starts from 0. Since N is very large N will be represented by a sequenceof K...

2018-06-21 20:22:43 295

原创 Killer Problem

You are given an array of N integers and Q queries. Each query is a closed interval [l, r]. You shouldfind the minimum absolute difference between all pairs in that interval.InputFirst line contains a...

2018-06-20 21:50:18 208

原创 Weird Advertisement (线段树+扫描线)

2DPlaneLand is a land just like a huge 2D plane. The range of X axis is 0 to 109 and the range ofY axis is also 0 to 109. People built houses only in integer co-ordinates and there is exactly one hous...

2018-06-20 21:40:51 267

原创 Movie collection (树状数组)

Mr. K. I. has a very big movie collection. He has organized his collection in a big stack. Whenever hewants to watch one of the movies, he locates the movie in this stack and removes it carefully, ens...

2018-06-20 21:29:39 610

原创 RMQ with Shifts (线段树)

In the traditional RMQ (Range Minimum Query) problem, we have a static array A. Then for eachquery (L, R) (L ≤ R), we report the minimum value among A[L], A[L + 1], . . . , A[R]. Note that theindices ...

2018-06-20 21:18:31 426

原创 Potentiometers (树状数组)

A potentiometer, or potmeter for short, is an electronic device with a variable electric resistance. Ithas two terminals and some kind of control mechanism (often a dial, a wheel or a slide) with whic...

2018-06-20 21:08:07 297

原创 Flights (解方程)

Army is busy: military exercises had started yesterday. All types of forces are doing, hopefully, a goodjob. For example, artillery is launching missiles, while aviation is delivering supplies to infa...

2018-06-20 20:57:17 328

原创 Frequent values (线段树)

You are given a sequence of n integers a1, a2, . . . , an in non-decreasing order. In addition to that, youare given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ n). For each query, dete...

2018-06-20 20:53:59 257

原创 日记(周末)

     做了周五的牛客网,只是签到抽奖。昨天晚上熬夜到凌晨4点半,打了cf。跟着ly大佬混了混,有史以来第一次比赛最后进了前一百,还是比较激动的,虽然最后全部挂了终测,咳咳,都错了。。。被打回原形。还是很高兴的。    发现这种通宵打比赛,还是少打,尽量不超过凌晨2点。昨晚通宵,今天一天都头疼,晚上还是睡好觉,白天会好很多。还有不知道这次是什么专题,有两道数学题,还有的题,没有考察什么算法,就是...

2018-06-17 20:54:30 135

原创 日记(周中)

    这几天,做了和研究了dp的题,还看了刚发的区间维护。因为看错题,写了一个线段树+扫描线。忽然发现需要改好多地方。并且对之前做的有些题做了整理和回忆。    打了周二的cf,并且...

2018-06-14 22:32:03 110

原创 走格子(简单dfs)

题目描述 在平面上有n*n大小的正方形,定义正方形左下角坐标是(1,1),右下角坐标是(n,1)现在A君在左下角,他的初始方向是向右,他要在正方形内走m步当A君碰到边界或者已经走过的格子时,他便会逆时针转90°继续走,直到走完m步。现在给你两个整数n和m,请算出走完m步后A君的坐标。输入描述:输入一行两个整数n和m。输出描述:输出一行两个数表示A君的坐标。示例1输入复制3 3输出复制3 2备注:n...

2018-06-12 12:00:38 1004

原创 求值2(组合数平方和)

题目描述 Ans = 0; For(inti = 1; i <= n; i++)     For(int v = 0; v <= n; v++)         Ans = (Ans + C(i, v) * C(i, v)) % 998244353;C(i,v)为组合数第i行第v列的数。给你上面的代码中的n,请你输出Ans的值。输入描述:输入一个整数n输出描述:输出Ans的值。示例1输...

2018-06-12 11:58:34 3301

原创 托米去购物(最大权闭合子图模型-最小割最大流)

题目描述 此时的托米老师已经出任CEO,迎娶白富美,走向了人生巅峰!于是这个暑假,托米老师打算在北京一个偏僻的小农村里度过他的假期。由于这里什么都没有,于是他去超市选了很多生活用品,更多的是吃的,然后推着堆满零食的购物车到柜台等待结账。当然,我们都知道他的钱包里有很多钱。但是,作为一名为生活精打细算的男孩子,他更愿意使用其他支付方式如:饭券,礼券,不同类型的优惠券等。但是饭券只能用于购买食物,而礼...

2018-06-12 11:48:46 279

原创 小小粉刷匠(区间dp)

题目描述 "lalala,我是一个快乐的粉刷匠",小名一边快活地唱着歌,一边开心地刷着墙",兴致突然被打断,"小名,你今天如果刷不完这一栋楼的墙,那么你就等着被炒鱿鱼吧",老板声嘶力竭的吼着。苦恼的小名因为不想被炒鱿鱼,所以希望尽量快地刷完墙,由于他本人的数学基础很差,他现在请你来帮助他计算最少完成每一堵墙需要刷多少次。每一面墙有n个段,对于每个段指定一个目标颜色ci。刚开始的时候所有的墙壁为白色...

2018-06-12 11:37:23 568

原创 String painter (区间dp+简单dp)

There are two strings A and B with equal length. Both strings are made up of lower case letters.Now you have a powerful string painter. With the help of the painter, you can change a segment ofcharact...

2018-06-12 11:26:40 469 1

原创 Taekwondo(dp)

Taekwondo is the name of a traditional Korean martial art and it is turned into a modern internationalsport. It is adopted by IOC (International Olympic Committee) as an official game of 2000 SydneyOl...

2018-06-12 11:10:06 262

原创 Optimal Cut (树形dp+记忆化)

A cut of a binary tree is a set of tree nodes such as for each possible path from the root node to anyleaf node, just one node in the cut belongs to the path. In a weighted binary tree, one can comput...

2018-06-12 10:41:11 459

原创 C. A Mist of Florescence(构造)

C. A Mist of Florescencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs the boat drifts down the river, a wood full of blossoms shows up on the ...

2018-06-12 10:31:43 759

原创 日记(周末)

    这些天来,做了dp4的一点题。不过,做的dp3的题的博客,还没整理完。。    首先打了周五的牛客网的比赛,当然,就是水了两道。因为难了的题是不会的,得整理一下题目。还有今晚的cf,做了前三道,第四道也是会做的,但是时间不够,由于手速慢,思路成型比很多人都慢。所以速度是关键。   当然还学习了一下数论相关知识,几个简单知识点和简单博弈论,在寒假的集训有数论的专题,做了点那时候的题。基本都是...

2018-06-10 21:23:37 119

原创 And Then There Was One (约瑟夫环变形)

Let’s play a stone removing game.Initially, n stones are arranged on a circle and numbered 1, . . . , n clockwise (Figure 1). You are alsogiven two numbers k and m. From this state, remove stones one ...

2018-06-09 21:43:50 605

原创 日记(周中)

    做了两三道dp3的题。感觉对于有些dp有了点心得。    做了周中练习,发现自己还是那么菜。好像原来的练习白做了。明白,以后做题一定有意识的避免题目中的坑点。对于题目的第一思路还是好的。    看了下dp4,感觉难度比dp3增大了很多。做了一道区间dp,复杂程度比dp3多多了。一道套路区间dp题,竟然都这么麻烦。做了很多dp,一般区间dp,和树形dp,状态转移方式比较固定,属于好像的dp。...

2018-06-07 21:26:18 139

原创 Trainsorting (最长上升(下降)子序列)

Erin is an engineer. She drives trains. She also arranges the cars within each train. She prefers toput the cars in decreasing order of weight, with the heaviest car at the front of the train.Unfortun...

2018-06-05 11:38:33 536

原创 Happy Birthday (最长上升(下降)子序列)

Today it’s February 13th. It’s a very special day: Miguel’s birthday! Like every year, he’s organised abig celebration for all his friends. He prepared a succulent dinner at his house. Everyone had a ...

2018-06-05 11:34:31 261

原创 Racing Car Computer (区间dp)

The racing cars of today are equipped with so many sophisticated equipment. Introduction of a newvisual transducer which is interfaced with the on-board computer can tell you on the fly how manycars a...

2018-06-05 11:13:42 233

原创 日记(周末)

由于是周末,这半周来,打了点cf,还有牛客网的比赛。最让人高兴的是牛客网抽奖,终于中T恤了。然后还做了几道dp题,补了一些做过的题。看着今天的徐州比赛的榜,做了几道题。不知道能不能发出去。...

2018-06-03 22:17:14 112

空空如也

空空如也

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

TA关注的人

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