自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 Markdown 字体,字号和颜色

我是黑体字 我是微软雅黑 我是华文彩云 color=#0099ff size=72 face=”黑体” color=#00ffff color=gray 颜色名 十六进制颜色值 颜色 AliceBlue F0F8FF rgb(240, 248, 255) AntiqueWhite FAEBD7 rgb(250, 235, 215) Aqua 00F

2016-06-29 19:19:43 1002

转载 欢迎使用CSDN-markdown编辑器

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2016-05-22 08:10:25 327

原创 【重操旧业】 ROIR2018 管道监控

题意给出一棵边为字母的有根树,和若干条具有一定代价的串。可以花费对应的代价,覆盖一条与串对应的祖先后代链。求一种花费最少的方案,使所有边都被覆盖至少一次。​考虑用树形dp解决这道题。​设f[p][x]f[p][x]f[p][x]表示,满足从ppp到xxx的管道以及xxx的子树中所有管道都能受到监控(ppp是xxx祖先),的最小代价。那么,答案就是∑fa[x]=1f[1][x]\sum_{fa[x]=1}f[1][x]∑fa[x]=1​f[1][x]。注意此处不一定恰恰这些地方受到监控,受监控的管

2021-07-17 21:26:19 408 1

原创 历史行程

题意:给出串,多组询问,问区间[l,r]的两个数[i,j],ij不同,以i,j结尾的前缀最长公共后缀最大是多少。长度询问数1e5很容易想到弄个SA,求出height数组两个前缀的最长公共后缀对应着SA的位置之间height的最小值考虑一个height值对序列的贡献,也就是要弄出跨过每一个height的两点l,r,并且lr之间不存在更小的。就相当于在一个笛卡尔树上做子树合并,这个可以用...

2019-08-22 16:46:51 514

原创 codechef MXMN

题意:定义一条路径的权值为经过边边权的最大值两点u,v的权值为f(u,v)等于uv之间所有简单路径的权值的最小值两张图G1,G2,都有n个点G1点编号为[1,n][1,n][1,n],G2编号为[n+1,n+n][n+1,n+n][n+1,n+n]求∑u,v∈[1,n]f(u,v)∗f(u+n,v+n)\sum_{u,v\in [1,n]} f(u,v)*f(u+n,v+n)∑u,v∈[1...

2019-08-22 16:33:49 344 1

原创 多校Play Games with Rounddog

题意:给母串S记子串Sl,rS_{l,r}Sl,r​在母串中出现次数为Cl,rC_{l,r}Cl,r​对于每一个次数都有一个权重wiw_iwi​q组询问,对于一个子串T=S[l,r]T=S[l,r]T=S[l,r],A要选出k个A的子串Ri=Sli,riR_i=S_{l_i,r_i}Ri​=Sli​,ri​​,使得T∈suffix(Ri)T\in suffix(R_i)T∈suffix(R...

2019-08-22 12:20:55 279

原创 单词争霸

题意给n个单词,现在A和B进行博弈,A先手轮流取一个单词,满足这个单词不为之前取过的某个单词的前缀问A是否能赢,第一个取得单词可以是那些读入按字典序给样例input:5 9accarcarecarefulcarefullyoutput:careful串总长1e5 1s假装建ac自动机将每个串向读入中的最长前缀认爸爸形成一个森林博弈内容变为每次删掉一个点到根的...

2019-08-22 11:32:51 461

原创 构图

题意n个点,有点权,正数或负数,可以连边,边的代价为两端点权的积,但要满足最终的图每个点度数大于0,且一个正数点不能连超过1个负数点数据范围3e4,可以到2e5样例input4-1 2 -3 4output-15(-3向其他连边)显然不会成环,有环必有正数,因此答案一定是生成森林如果仅有正数或仅有负数,那么肯定是最大连最小,次大连次小……既有正数又有负数的话将正数负...

2019-08-22 10:51:03 163

原创 再放送

题意:树上随机游走,每个节点有权值vi,若存在某个房间未经过2次就走过去,否则停下,最终从S开始走权值的期望n 1e6样例Input25 81 21Output8发现走过的路形态不多前两种走完之后蓝点就被堵死了,第三四就停下了思路就很简单了设f[x]表示走到x的子树不能回头了,最后的期望g[x]表示往上到x,并且下一步要往上走或去其他子树或者死在上面,最后的期望...

2019-08-22 09:30:38 161

原创 幻方

题意:1e6组询问求满足下列要求的n*n整数矩阵个数:∀i,j,ai,j∈[0,m)\forall_{i,j},a_{i,j}\in[0,m)∀i,j​,ai,j​∈[0,m)∃C满足∀iC=∑j=1nai,j,∀iC=∑j=1naj,i,∀iC=∑j=1naj,j,且∀iC=∑j=1naj,n−j+1\exist_C满足\forall_iC=\sum_{j=1}^na_{i,j},\f...

2019-08-22 09:04:20 158

原创 【模拟赛12.28】T1

Time Limit 2sMemory Limit 512MDescription从1到n中选k个互不相同的,问一起为边长能组成凸k边形的方案数Input一行,n,kOutput一行答案对998244353取模SampleInput1100 3Output179625Input2100 4Output23281225Input3100 5Output3724...

2019-01-03 11:51:47 243

原创 【模拟赛12.22】Graph

Time Limit 3sMemory Limit 512MDescription认定两个黑白二分图不同当且仅当某两个点在一个二分图中有边在另一个中没边,或者在两个图中边颜色不同,求n个点的不同的黑白二分图的个数Input第一行T数据组数,然后T行每行nOutput每行一个答案对998244353取模SampleInput32310Output3194353635...

2018-12-29 22:12:45 149

原创 NOIP 2018总结

停了一个月课。。。文化课跟没停过似的。。。训练期间硬要自己能稳定一些,结果NOIP还是喜闻乐见的炸了先谈谈day1今年D1是我见过最简单的一套,但这一天我好像并没有AK。。。一开始我还兴奋的以为自己300了,但是好像T3少了点什么,只有280,第三题往正解那边去想,但不知咋的就想错了一个地方,刚开始还以为死成0分了,然而仔细一看m=1的、链菊花图二叉树都能过,就剩下最后的20分可能拿不到,可...

2018-11-17 09:31:23 421

原创 【51nod1327】棋盘游戏

题意n×m的棋盘,放棋子,要求第i行左边lil_ili​个格子和右边rir_iri​个格子各恰好有一个棋子,且每一列最多只能有1个棋子,问方案数,对109+710^9+7109+7取模n≤50,m≤200n\leq50,m\leq200n≤50,m≤200Solution这是一道DP好题。太菜了以至于我想了半天连状态都没想到。考虑到每一列最多放一个,那么考虑在列上做文章,设f[i][]...

2018-10-31 22:43:31 568

原创 明日之星

Time Limits: 5000 ms Memory Limits: 524288 KBDescriptionn位舞台少女各自有一个番号,番号是由‘A’、‘C’、‘G’、‘T’、‘U’五种字符组成的字符串,某种未知力量导致不同的舞台少女的番号可能相同。我们把第i位舞台少女的番号记作s[i],且每位舞台少女还会有一个梦想值a[i]。舞台少女之间互相建立了友好的关系,如果把关系看作边,那么...

2018-10-28 22:46:12 403

原创 moon

Description平面直角坐标系中有n个景点,坐标分别为(xi,yi)你一开始可以选择任意一个一个点(不一定是景点),开始移动每次移动按照下面的顺序操作:1、 选择一条直线,要求直线经过现在的位置且这条直线包含至少两个景点,如果有多条直线满足要求,等概率选择一条。2、 在选择的这条直线中,等概率选择一个直线覆盖了的景点移动过去,如果目前在景点上,也有可能停住不动。若干次询问,第i...

2018-10-28 22:16:06 159

原创 论优化寻址时间的重要性

background冥思苦想。。。哇!这题我会做!——但时间有点紧!——没事!打!1 hour later,码完了!拍!拍对了!交!“WOC,T70!这。。。”(拍案而起,怒目圆睁)(隔壁一大佬)“诶!我过了!贼快!”“你什么方法?”“!@#KaTeX parse error: Expected 'EOF', got '#' at position 22: …不是一样吗,题解呢?”...

2018-10-28 21:47:00 692 1

原创 种花(derangement)

题意定义一个排列a,f(a)=∑i<j,且ai>aj(j−i)(ai−aj)f(a)=\sum_{i\lt j,且a_i>a_j}(j-i)(a_i-a_j)f(a)=∑i<j,且ai​>aj​​(j−i)(ai​−aj​)求对于所有n的排列a,满足ai̸=pi,f(a)a_i\not=p_i,f(a)ai​̸​=pi​,f

2018-10-28 21:04:09 154

原创 排列期望LIS

如题,求n的排列的LIS的期望值难点主要在统计LIS的总数算法一暴力每一种排列,nlogn计算LIS,时间复杂度O(n!log⁡n)O(n!\log n)O(n!logn)算法二DP对于一个n的排列,设h[i]h[i]h[i]表示最长的末位不超过i的最长上升子序列,比如说{3,1,2,5,4}\{3,1,2,5,4\}{3,1,2,5,4}中,h[3]=2 ,h[4]=3h...

2018-10-27 14:55:32 445

原创 【Codeforces944F】Game with Tokens

time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard outputDescription Consider the following game for two players. There is one white token and...

2018-07-10 07:56:47 285

原创 【codeforces948D】 Curfew

time limit per test:2 seconds memory limit per test:512 megabytes input:standard input output:standard outputDescription Instructors of Some Informatics School make students go to bed.The hous...

2018-07-09 21:49:45 351

原创 【codeforces923D】Picking Strings

time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Description Alice has a string consisting of characters ‘A’, ‘B’ and ‘C’. Bob can use...

2018-07-09 21:40:08 173

原创 【JZOJ5755】【SDOI2018】战略游戏

(File IO): input:game.in output:game.out Time Limits: 10000 ms Memory Limits: 524288 KBDescription省选临近,放飞自我的小 Q 无心刷题,于是怂恿小 C 和他一起颓废,玩起了一款战略游戏。这款战略游戏的地图由 n个城市以及 m条连接这些城市的双向道路构成,并且从任意一个城市出发总能沿着道...

2018-07-03 12:57:10 465

原创 【JZOJ5296】Sequence

Time Limits: 2000 ms Memory Limits: 524288 KB Detailed Limits Description Input Output Sample Input10 5 4 8 9 1 6 3 2 7 10 5 6 3 4 1 2 10 7 8 9 5 3 7 2 4 1 3 10 3 7 4 6 8 1 3 1 ...

2018-07-02 21:53:20 210

原创 【JZOJ5278】神奇的车票

(File IO): input:ticket.in output:ticket.out Time Limits: 2000 ms Memory Limits: 1048576 KB Detailed Limits Description Input Output Sample Input22 22 3Sample Output519Data...

2018-07-02 14:37:55 157

原创 【Codeforces960F】Pathwalks

time limit per test:1 second memory limit per test:256 megabytes standard input standard outputDescription You are given a directed graph with n nodes and m edges, with all edges having a certai...

2018-07-02 07:56:27 269

原创 【Codeforces960G】 Bandit Blues

time limit per test:3.5 seconds memory limit per test:256 megabytes standard input standard outputDescription Japate, while traveling through the forest of Mala, saw N bags of gold lying in a ro...

2018-07-02 07:43:39 262

原创 【Codeforces960H】 Santa's Gift

time limit per test:4 seconds memory limit per test:512 megabytes standard input standard outputDescription Santa has an infinite number of candies for each of m flavours. You are given a rooted...

2018-07-01 22:09:04 345

原创 【Codeforces986F】 Oppa Funcan Style Remastered

time limit: per test 5 seconds memory limit: per test 256 megabytes standard input standard outputDescription Surely you have seen insane videos by South Korean rapper PSY, such as “Gangnam Styl...

2018-06-28 19:59:00 384

原创 【Codeforces967E】May Holidays

time limit: per test 5 seconds memory limit: per test 256 megabytes standard input standard output Description It’s May in Flatland, and there are m days in this month. Despite the fact that May ...

2018-06-28 10:29:17 363

原创 【codeforces986E】 Prince's Problem

time limit:per test 3 seconds memory limit:per test 512 megabytes standard input standard outputDescription Let the main characters of this problem be personages from some recent movie. New Aven...

2018-06-27 07:52:06 319

原创 【codeforces986C】AND Graph

time limit :per test 4 seconds memory limit :per test 256 megabytes standard input standard outputDescription You are given a set of size m with integer elements between 0 and 2n−1 inclusive. Le...

2018-06-27 07:25:35 205

原创 【codeforces994E】. Nikita and Order Statistics

time limit: per test2 seconds memory limit :per test256 megabytes standard input standard outputDescription Nikita likes tasks on order statistics, for example, he can easily find the k-th numbe...

2018-06-26 22:36:05 374

原创 【codeforces994D】Compute Power

time limit:per test 1 second memory limit:per test 256 megabytes standard input standard outputDescription You need to execute several tasks, each associated with number of processors it needs, ...

2018-06-26 22:24:17 428

原创 自我剖析

又到凤凰花开时,一年毕业季如期而至—— 自信心满满地从考场中走出来,告别了初中,迎来了人生中又一重要的阶段—— 高中,轻悄悄的来到—— 初中一切的一切,都已成为过去,无论是那些满分试卷,还是金灿灿的奖牌;无论是那一沓又一沓的草稿纸,还是一支支用坏了的比,都已成为过去时。留下那一张又一张充满同学们灿烂的笑容的相册,一张又一张抒写了内心真情的同学录,都是过去辉煌的初中时代的见证,而现在,我们将为...

2018-06-25 20:24:07 466

原创 【JZOJ5745】幂

Time Limits: 3000 ms Memory Limits: 1048576 KB Detailed Limits Description Input Output SampleInput1:3Output1:1Input2:4Output2:-1Input3:15Output3:2Data Constraint anal...

2018-05-28 19:55:44 169

原创 【JZOJ5689】二进制

Description Pupil 发现对于一个十进制数,无论怎么将其的数字重新排列,均不影响其是不是3 的倍数。他想研究对于二进制,是否也有类似的性质。于是他生成了一个长为n的二进制串,希望你对于这个二进制串的一个子区间,能求出其有多少位置不同的连续子串,满足在重新排列后(可包含前导 0)是一个3的倍数。两个位置不同的子区间指开始位置不同或结束位置不同。由于他想尝试尽量多的情况,他有时会修改串...

2018-05-23 20:22:01 304

原创 【JZOJ5664】凫趋雀跃

Description Input Output Sample Input2 2 1 1 3 0Sample Output6Data Constraint Hint analysis因为不能不走,那么将(0,0)也归为一种不合法的走法 那k个向量真的好难看哦 于是考虑用容斥排除他们对做题造成的影响。 设f[i][x][y]f[i]...

2018-05-23 20:05:24 340

原创 【JZOJ5663】呼吸决定

Time Limits: 1000 ms Memory Limits: 30760 KB Description Input Output Sample Input10 3Sample Output714Data Constraint analysis这。。。空间有点醉杜教筛的常用套路 设f[n]=∑ni=1imμ(i)f[n...

2018-05-23 19:44:46 428

原创 【JZOJ5661】药香沁鼻

Description Input Output Sample Input6 91 1 11 1 1008 1 11 3 62 3 10004 1 4Sample Output105Hint 【样例解释】 其中一种最优解为:小 C?用 8 点能量摘下第 1,2,4,6 朵花,并放在药材中熬煮,由于第 4 朵花所钦慕的 3 号花不在药材中,所以第...

2018-05-23 19:22:46 370

空空如也

空空如也

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

TA关注的人

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