自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

LuRiCheng的博客

退役了.

  • 博客(21)
  • 收藏
  • 关注

原创 玲珑OJ 1149 - Buildings 【尺取法】

题目链接<\a>显然通过尺取法可以找到每次以j为结尾,包含j的区间,往左延伸,最左能到i (i<=j) 于是以j为结尾的区间有(j-i+1)个 累加即可#include<stdio.h>#include<bits/stdc++.h>#define ll long long#define pii pair<int,int>#define pll pair<ll,ll>#define ME

2017-07-30 15:09:42 429

原创 玲珑OJ 1152 - Expected value of the expression 【DP】

题目链接显然可以拆位,20个位单独考虑 dp[i][j]=前i对OiAi,满足第j位为1的概率dp[i][j]=前i对O_iA_i,满足第j位为1的概率 dp[i][j]=dp[i−1][j]+(1−dp[i−1][j])∗(1−pi)           Oi= or 且(ai>>j) and 1=1dp[i][j]=dp[i-1][j]+(1-dp[i-1][j])*(1-p_i)

2017-07-30 14:57:10 338

原创 【2017多校】HDU6053 TrickGCD 【莫比乌斯】

枚举gcd(l,r)=d的倍数,则b[i]可能的值为{d,2d,3d,...,floor(a[i]/d)∗d}枚举gcd(l,r)=d的倍数,则b[i]可能的值为\{d,2d,3d,...,floor(a[i]/d)*d\} 则gcd(l,r)=d的倍数时,方案数=∏ni=1a[i]d则gcd(l,r)=d的倍数时,方案数=\prod_{i=1}^{n}\frac{a[i]}d 显然剩下就是容斥

2017-07-28 16:18:20 468

原创 【2017多校】HDU6047 Maximum Sequence 【贪心】

显然每个bi都要被选择一次,每次贪心的选出an+k=max{aj | bi<=j<n+k}显然每个b_i都要被选择一次,每次贪心的选出a_{n+k}=max\{a_{j}\ |\ b_i<=j<n+k\} 求出ai的后缀最大值a′i=max(a[j] | j>=i)求出a_i的后缀最大值 a'_i=max(a[j] \ | \ j>=i) 对bi从小到大排序,依次选取即可,顺便维护一个maxVa

2017-07-28 14:43:43 369

原创 【2017多校】HDU6035 Colorful Tree 【听说是树形DP】

官方题解:单独考虑每一种颜色,答案就是对于每种颜色至少经过一次这种的路径条数之和。反过来思考只需要求有多少条路径没有经过这种颜色即可。直接做可以采用虚树的思想(不用真正建出来),对每种颜色的点按照 dfs 序列排个序,就能求出这些点把原来的树划分成的块的大小。这个过程实际上可以直接一次 dfs 求出。令sum[i]=已经dfs遍历过的点中,以i颜色的点为根的子树的节点个数之和(不重复计数)令sum[

2017-07-26 20:30:00 764

原创 51NOD 1554 欧姆诺姆和项链 【kmp】

1554 欧姆诺姆和项链题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注有一天,欧姆诺姆发现了一串长度为n的宝石串,上面有五颜六色的宝石。他决定摘取前面若干个宝石来做成一个漂亮的项链。他对漂亮的项链是这样定义的,现在有一条项链S,当S=A+B

2017-07-25 11:01:40 489

原创 Codeforces 800C. Vulnerable Kerbals 【DAG图最长路】

C. Vulnerable Kerbalstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an integer m, and a lis

2017-07-18 20:02:50 484

原创 51NOD 1277 字符串中的最大值 【拓展KMP】

1277 字符串中的最大值题目来源: Codility基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注一个字符串的前缀是指包含该字符第一个字母的连续子串,例如:abcd的所有前缀为a, ab, abc, abcd。给出一个字符串S,求其所有前缀中,字符长度与出现次数的乘积的最大值。

2017-07-17 21:21:38 429

原创 Codeforces B. Cards Sorting 【瞎搞】

B. Cards Sortingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasily has a deck of cards consisting of n 

2017-07-17 15:47:03 590

原创 Codeforces 830A. Office Keys 【dp】

A. Office Keystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n people and k keys on a straigh

2017-07-17 15:24:32 656

原创 玲珑OJ1146 - 图论你先敲完模板 【DP】

1146 - 图论你先敲完模板Time Limit:5s Memory Limit:256MByteSubmissions:731Solved:186DESCRIPTION今天HHHH在操场上跑步,HHHH作为一个爱运动的人,肯定会想方设法把跑步所消耗的能量减到最少.现在这个操场上有nn个可以休息的点,他们的坐标分别为x1,x2...

2017-07-15 20:45:58 525

原创 Codeforces 815B. Karen and Test 【规律】

B. Karen and Testtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputKaren has just arrived at school, and she

2017-07-14 17:10:11 591

原创 Codeforces 815C. Karen and Supermarket 【树形DP】

C. Karen and Supermarkettime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputOn the way home, Karen decided to

2017-07-14 15:06:43 543

原创 Codeforces 827B. High Load 【构造】

B. High Loadtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputArkady needs your help again! This time he dec

2017-07-12 16:08:21 639

原创 Codeforces 827A. String Reconstruction

A. String Reconstructiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIvan had string s consisting of small English letters. However, his fr

2017-07-12 15:56:07 559

原创 Codeforces 819B. Mister B and PR Shifts

B. Mister B and PR Shiftstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSome time ago Mister B detected a strange signal from the space, whic

2017-07-11 19:47:29 636

原创 SHU金马五校赛 L.零件组装 【状压DP】

零件组装发布时间: 2017年7月9日 20:20 最后更新: 2017年7月10日 21:12 时间限制: 1000ms 内存限制: 128M描述现有n个零件,小Y花费了很多时间来收集它们,现在他想把零件拼在一起,拼完就可以召唤神龙了。已知零件之间存在相邻的关系,拥有相邻关系的零件在最终的组装结果中就是相邻的,并且组装过程中每次只能通过相邻关系来组合零件。小Y每次可以选择两个零件(

2017-07-11 17:25:10 472

原创 POJ3469 Dual Core CPU 【最大流最小割】

Language:DefaultDual Core CPUTime Limit: 15000MSMemory Limit: 131072KTotal Submissions: 24695Accepted: 10690Case Time Limit: 5000MSDescriptionAs more and more computers are equipped with dual core CPU

2017-07-08 21:01:49 431

原创 POJ3057 Evacuation 【二分匹配】

EvacuationTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3050 Accepted: 766DescriptionFires can be disastrous, especially when a fire breaks out in a room that is completely fill

2017-07-07 22:52:37 391

原创 POJ2104 K-th Number 【线段树+二分】

K-th NumberTime Limit: 20000MS Memory Limit: 65536KTotal Submissions: 57392 Accepted: 19837Case Time Limit: 2000MSDescriptionYou are working for Macrohard company in data structures depa

2017-07-05 22:28:53 585

原创 POJ3468 A Simple Problem with Integers 【线段树/BIT】

A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 110542 Accepted: 34432Case Time Limit: 2000MSDescriptionYou have N integers, A1, A2, ... , AN. Yo

2017-07-05 15:59:03 389

空空如也

空空如也

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

TA关注的人

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