Codeforces
文章平均质量分 73
Dream_Maker_yangkai
OIER 原dream_maker_yk
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces 17E Palisection 【Manacher】
Codeforces 17E Palisection E. Palisection In an English class Nick had nothing to do at all, and remembered about wonderful strings called palindromes. We should remind you that a string is call...原创 2018-06-21 21:27:49 · 384 阅读 · 0 评论 -
【Codeforces】Round #491 (Div. 2) 总结
【Codeforces】Round #491 (Div. 2) 总结 这次尴尬了,D题fst,E没有做出来。。。。 不过还好,rating只掉了30,总体来说比较不稳,下次加油 A:If at first you don’t succeed… SB题,就是注意一下特判就好了,然后我一开始wa了三次。。。 #include<bits/stdc++.h> ...原创 2018-06-24 18:04:08 · 289 阅读 · 0 评论 -
【Codeforces】Round #488 (Div. 2) 总结
【Codeforces】Round #488 (Div. 2) 总结 比较僵硬的一场,还是手速不够,但是作为正式成为竞赛生的第一场比赛还是比较圆满的,起码没有FST,A掉ABCD,总排82,怒涨rating两百 A:Fingerprints A题,就在第一个串中查找第二个串中的数字,最气的是一开始没编译直接交CE了,噗 #include&lt;iostream&gt; #i...原创 2018-06-17 22:47:41 · 466 阅读 · 0 评论 -
Codeforces 25E Test 【Hash】
Codeforces 25E Test E. Test Sometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to his problem is one string. Bob...原创 2018-06-21 14:37:28 · 338 阅读 · 0 评论 -
Codeforces 932E Team work 【组合计数+斯特林数】
Codeforces 932E Team work You have a team of N people. For a particular task, you can pick any non-empty subset of people. The cost of having x people for the task is xk. Output the sum of costs o...原创 2018-07-12 18:26:43 · 441 阅读 · 0 评论 -
Codeforces 15E Triangles 【组合计数】
Codeforces 15E Triangles Last summer Peter was at his granny’s in the country, when a wolf attacked sheep in the nearby forest. Now he fears to walk through the forest, to walk round the forest, ev...原创 2018-07-12 22:08:55 · 541 阅读 · 0 评论 -
Codeforces 382E Ksenia and Combinatorics 【组合计数】*
Codeforces 382E Ksenia and Combinatorics Ksenia has her winter exams. Today she is learning combinatorics. Here’s one of the problems she needs to learn to solve. How many distinct trees are there...原创 2018-07-12 23:32:58 · 478 阅读 · 0 评论 -
Codeforces 1012C Hills【DP】*
Codeforces 1012C Hills Welcome to Innopolis city. Throughout the whole year, Innopolis citizens suffer from everlasting city construction. From the window in your room, you see the sequence of n h...原创 2018-07-30 22:03:58 · 748 阅读 · 0 评论 -
Codeforces R1027E Inverse Coloring 【DP】
Codeforces R1027E Inverse Coloring 题目链接 题目大意是给你一个n*n的棋盘,然后你需要将它黑白染色 相邻的行列要么完全相同,要么完全不相同 然后不能出现同色矩形包含大于等于k个色块 好性质: 所以我们只需要一行一列的状态就可以确定所有格子的状态 然后我们考虑DP啊,dp[i][j]dp[i][j]dp[i][j]表示长度为i的一行、列最长...原创 2018-08-19 18:53:40 · 665 阅读 · 0 评论 -
Codeforces 9D How many trees? 【计数类DP】
Codeforces 9D How many trees? LINK 题目大意就是给你一个n和一个h 问你有多少个n个节点高度不小于h的二叉树 n和h的范围都很小 感觉有无限可能 考虑一下一个很显然的DP dpn,h表示n个节点组成的高度为h的树的方案数dpn,h表示n个节点组成的高度为h的树的方案数dp_{n,h}表示n个节点组成的高度为h的树的方案数 然后考虑咋转移...原创 2018-08-26 22:17:36 · 434 阅读 · 0 评论 -
Codeforces 914H Ember and Storm's Tree Game 【DP】*
Codeforces 914H Ember and Storm’s Tree Game 题目链接 ORZ佬 果然出了一套自闭题 这题让你算出第一个人有必胜策略的方案数 然后我们就发现必胜的条件就是树上的每条路径都是单调或者单峰的 所以我们考虑DP一个每条路径都是单调或单峰的树出来 所以考虑DPf[i][j]f[i][j]f[i][j]表示大小是i的子树根节点的度数是j,并且满...原创 2018-08-21 21:39:20 · 351 阅读 · 0 评论 -
Codeforces 280C Game on tree【概率DP】
Codeforces 280C Game on tree LINK 题目大意:给你一棵树,1号节点是根,每次等概率选择没有被染黑的一个节点染黑其所有子树中的节点,问染黑所有节点的期望次数 然后这个题一样看过去就是期望DP 因为期望的线性性,我们可以分别考虑每一个节点被染黑的期望次数 然后就是一个节点被染黑只有可能是他本身和他的所有父亲,然后实际上操作在这个点上的概率只有1de...原创 2018-08-25 16:33:46 · 504 阅读 · 0 评论 -
Codeforces 28C Bath Queue 【计数类DP】*
Codeforces 28C Bath Queue LINK 简要题意:有 n 个人等概率随机进入 m 个房间,一个房间可以有多个人,第 i 个房间有 ai 个水龙头,在一个房间的人要去排队装水,他们会使得最长的队尽可能小,求所有房间中最长队列长度的期望 Mark一个很好的blog 然后快考虑这题咋做 你先看n的范围感觉是n5n5n^5的DP 因为对于每个人,进入每个房间的...原创 2018-08-25 20:55:46 · 565 阅读 · 0 评论 -
Codeforces 834D The Bakery 【线段树优化DP】*
Codeforces 834D The Bakery LINK 题目大意是给你一个长度为n的序列分成k段,每一段的贡献是这一段中不同的数的个数,求最大贡献 是第一次做线段树维护DP值的题 感觉还可以,虽然看了一下这题是用线段树维护DP值 然后说思路 有一个很显然的思路是这样的: dpi,jdpi,jdp_{i,j}表示前i个数分成j段的最大贡献 dpi,j=max(dp...原创 2018-09-02 20:47:25 · 303 阅读 · 0 评论 -
Codeforces 954H Path Counting 【DP计数】*
Codeforces 954H Path Counting LINK 题目大意:给你一棵n层的树,第i层的每个节点有a[i]a[i]a[i]个儿子节点,然后问你树上的简单路径中长度在1&nbsp;n∗2−21&nbsp;n∗2−21~n*2-2之间的每个有多少条 因为直接计算过每个节点的路径并不好算 所以可以算一算从每个节点出发的路径的个数 f[i][j]f[i][j]f[i...原创 2018-09-02 22:05:28 · 347 阅读 · 0 评论
分享