自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Codeforces Round #381 (Div. 1) C. Alyona and towers(线段树)

Alyona has built n towers by putting small cubes some on the top of others. Each cube has size 1 × 1 × 1. A tower is a non-zero amount of cubes standing on the top of each other. The towers are next t...

2018-10-30 23:10:23 168

原创 Codeforces Round #385 (Div. 1) B. Hongcow's Game(bitmask)

This is an interactive problem. In the interaction section below you will see the information about flushing the output.In this problem, you will be playing a game with Hongcow. How lucky of you!H...

2018-10-30 17:08:38 117

原创 Codeforces Round #384 (Div. 2) E. Vladik and cards 状压dp

题目链接http://codeforces.com/contest/743/problem/E题面Vladik was bored on his way home and decided to play the following game. He took n cards and put them in a row in front of himself. Every card ha...

2018-10-29 22:31:26 101

原创 B. Arpa's weak amphitheater and Mehrdad's valuable Hoses(背包)滚动数组吧

 有n个女孩,每个女孩有一个体重和颜值,并分为k个朋友团队。两个女孩x,y在同一个团队的条件是存在a1(x), a2, ..., ak(y) 其中ai 和 ai + 1 是朋友( 1 ≤ i < k).每个团队要么全取,那么取不超过。问在总重量不超过w的情况下能取到的最大颜值和。 #include<iostream>#include<cstdio>...

2018-10-29 16:53:23 145

原创 Codeforces Round #381 (Div. 1) B. Alyona and a tree dfs序 二分 前缀和

 B. Alyona and a tree题目连接:http://codeforces.com/contest/739/problem/BDescriptionAlyona has a tree with n vertices. The root of the tree is the vertex 1. In each vertex Alyona wrote an positi...

2018-10-29 10:14:53 104

原创 【Codeforces 738F】 Financiers Game【记忆化DP】

题意:有一个数列,两个人分别从两端开始取数字,左边的先取,第一次能取1个或2个,然后轮流取得时候,如果第一个取了k个,后一个人只能取k或k+1个,如果剩下的不够了则游戏终止,I想要最大化两个人取得数字之和的差距,Z想要最小化,两个人都选择最优操作题解:重点是空间时间复杂度上述算法看起来是n3次的dp[L][R][K]但实际上L最多只能达到2000多一点的样子(I多拿一次数字的情...

2018-10-28 18:54:07 125

原创 【Codeforces 736C】 Ostap and Tree【树形DP】

题意:问对一棵树染色,初始无色,要求距每个点最近的染色点的距离不超过k题解:写的比较蠢,dp[i][j]记录第i个点关键色点深度为j的种类数,关键点:这棵树u如果已经满足了,j就是离u最近色点;如果不满足,j是最远色点。枚举子树,考虑容斥,设计叶子记录。。。。最大长和(2k+1)有更好的大概https://blog.csdn.net/sjtsjt709/article/detail...

2018-10-28 01:00:22 158

转载 Codeforces Round #379 (Div. 2) E. Anton and Tree 缩点 直径

 E. Anton and Tree题目连接:http://codeforces.com/contest/734/problem/EDescriptionAnton is growing a tree in his garden. In case you forgot, the tree is a connected acyclic undirected graph.The...

2018-10-26 23:40:40 94

原创 CodeForces 733 E.Sleep in Class

Description n层楼,每层有一个指示牌指示当前是上一层还是下一层,每经过一层指示牌就会反向,对于一个起点i,最后要经过多少步才能到第0层或者第n+1层,对于每个i输出结果 Input 第一行一整数n表示楼层数,之后一个长度为n的字符串表示初始状态每层的指示方向(1<=n<=1e6) Output 输出n个整数,第i个整数表示初始时在第i层时要经过多少步才能出去,如果...

2018-10-25 21:50:07 232

原创 D. 80-th Level Archeology 区间扫描

Archeologists have found a secret pass in the dungeon of one of the pyramids of Cycleland. To enter the treasury they have to open an unusual lock on the door. The lock consists of n words, each consi...

2018-10-23 21:24:05 172

转载 Codeforces Round #376 (Div. 2) F. Video Cards(前缀和)

题目链接F. Video Cardstime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputLittle Vlad is fond of popular computer game Bota-2. Recently, the deve...

2018-10-23 00:28:40 136

转载 Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) C. Ray Tracing 数学 C. Ray Tracing

题目连接:http://codeforces.com/contest/724/problem/CDescriptionoThere are k sensors located in the rectangular room of size n × m meters. The i-th sensor is located at point (xi, yi). All sensors ar...

2018-10-12 00:45:12 179

转载 Codeforces Round #375 (Div. 2) F. st-Spanning Tree

传送门:Codeforces Round #375 (Div. 2) F. st-Spanning Tree题意: 给你n个点,m条边,有两个给定的点S,T以及它们在生成树中最大的度数 求能否构造出一棵树,使得这两个点的度数满足要求思路: 求出不使用与S,T有关的边构成的联通块 这些联通块与S,T有三种联通情况 1.只与S相连 2.只与T相连 3.与S和T均相连 记录一下已...

2018-10-12 00:22:10 111

转载 Codeforces Round #375 (Div. 2) E One-Way Reform(欧拉路径

题目链接E. One-Way Reformtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cities and m two-way roads in Berland, each r...

2018-10-09 00:44:44 86

转载 codeforces 721E. Road to Home(DP+单调队列)

题目链接:http://codeforces.com/contest/721/problem/E题目大意:在一条坐标范围为[0,L]的路上有n盏路灯,每盏路灯有一个照亮范围[li,ri]且没有重叠部分也不相接。某人想在被路灯照到的地方唱歌,他唱一首歌将走过p的距离,一首歌一定要唱完整。在唱完一首歌后,他可以选择接着唱或者停止,如果停止那么下一次唱歌的位置必须与停止的位置相隔至少t距离。问他最多能唱...

2018-10-07 01:47:10 166

转载 【Codeforces Round 374 (Div 2)C】【DAG上的DP】

C. Journeytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Irina arrived to one of the most famous cities of Berland — t...

2018-10-06 00:43:30 165

转载 codeforces 718E. Matvey's Birthday

题目链接:http://codeforces.com/contest/718/problem/E题目大意:给定一个长度为n的只包含a~h的字符串s,对于1<=a,b<=n,,如果|a-b|=1或s[a]=s[b],就在a与b之间连一条无向边,求这个图的直径以及有多少对点的距离(这里指最短距离)等于这个直径。直径即一个图中距离最大的两个点之间的距离。数据范围:2<=n<=10...

2018-10-05 00:50:00 109

空空如也

空空如也

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

TA关注的人

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