自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

绝尘

菩提本无树,明镜亦非台。 本来无一物,何处惹尘埃!

  • 博客(26)
  • 资源 (4)
  • 问答 (2)
  • 收藏
  • 关注

原创 【UVA11426】GCD - Extreme (II)——欧拉函数

Given the value of N, you will have to find the value of G. The definition of G is given below: G=∑i=1n∑j=i+1nGCD(i,j)G= \sum\limits_{i=1}^{n} \sum\limits_{j=i+1}^nGCD(i,j) Here GCD(i, j) means the gr

2016-03-30 18:07:27 855

原创 【UVA11361】Investigating Div-Sum Property——数位DP

An integer is divisible by 3 if the sum of its digits is also divisible by 3. For example, 3702 is divisible by 3 and 12(3+7+0+2) is also divisible by 3. This property also holds for the integer 9. I

2016-03-28 19:52:17 915 2

原创 【LA3516】Exploring Pyramids——动态规划+乘法原理

Archaeologists have discovered a new set of hidden caves in one of the Egyptian pyramids. The decryption of ancient hieroglyphs on the walls nearby showed that the caves structure is as follows. Ther

2016-03-28 08:21:07 716

原创 【UVA11174】Stand in a Line——逆元+树形Dp

All the people in the byteland want to stand in a line in such a way that no person stands closer to the front of the line than his father. You are given the information about the people of the bytela

2016-03-27 19:53:19 570

原创 【UVA11137】Ingenuous Cubrency——完全背包

题意:给你一个数n,将n分解成若干个正整数的立方之和,问有多少种方式。 分析:将一个数ii的立方数作为一个物品,体积为i3i^3,每一个物品的个数没有限制,转化为完全背包的形式。 #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <iostream> #include <alg

2016-03-27 17:16:52 455

原创 【UVA11806】Cheerleaders——容斥

题意:给你一个n×mn \times m的矩阵网格和k个人,问有多少种方法使得每一个格子只放一个人,并且第一行,最后一行,第一列,最后一列都有人。 分析:如果没有限制条件,我们知道答案是ans=C(nm,k),但是有限制条件,我们定义A表示第一行没有人,B表示最后一行没有人,C表示第一列没有人,D表示最后一列没有人,我们可以得到答案是ans=ans−A−B−C−D+AB+AC+AD⋯+AB

2016-03-25 19:47:40 574

原创 【PAT天梯赛练习集L2-1】紧急救援——SPFA

作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。输入格式:输入第一行给出4个正整数N、M、S、D,其中N(2<=N<=500)是城市的个数,顺便假设城市的编号

2016-03-24 22:02:56 3578

原创 【UVA10325】The Lottery——简单容斥定理

题意:给你一个数组,问[1,n][1,n]中有多少个数不能整除数组的任何一个数 分析:对于这种问题,我们可以求其逆问题,就是在区间[1,n]中存在多少数可以整除数组中的只少一个数 对于a[i],可以整除它的数的数量为Ai=na[i],但是我们不能将每一个数的数量加起来,因为存在重复元素a[i],可以整除它的数的数量为A_i = \frac{n}{a[i]},但是我们不能将每一个数的数

2016-03-24 21:41:38 738

原创 【UVA11401】Triangle Counting——计算方法

题意:从 1,2,3⋯,n1,2,3\cdots ,n中选出三个不同的整数,使它们能够组成三角形,问有多少种方法 分析:设最长的边为xx,另外的两条边为y,z\quad y,z ,所以y+z>x\quad y+z>x,所以z的范围为x>z>x−yx>z>x-y 当y=1时,x>z>x−1显然无解当\quad y =1 时,x>z>x-1\quad 显然无解 当y=2时,x>z>

2016-03-24 20:55:24 853

原创 【UVA11538】Chess Queen——简单组合

题意:给你一个n×mn \times m 的棋盘,在上面放两个皇后,(一黑一白)问有多少种放的方法 分析:皇后的攻击的范围为同一行或者同一列或者在同一对角线,这三种情况没有交集,利用加法原理,对于同一行的放置数目为A(n,m)=n×m×(m−1)A(n,m) = n\times m\times (m-1),同一列的放置为B(m,n)=m×n×(n−1)B(m,n) = m\times n

2016-03-24 19:54:28 749

原创 【Ural1073】 Square Country——完全背包

Time limit: 1.0 second Memory limit: 64 MBThere live square people in a square country. Everything in this country is square also. Thus, the Square Parliament has passed a law about a land. According

2016-03-22 17:37:50 574

原创 【Ural1167】 Bicolored Horses——基础Dp

Time limit: 1.0 second Memory limit: 64 MBEvery day, farmer Ion (this is a Romanian name) takes out all his horses, so they may run and play. When they are done, farmer Ion has to take all the horses

2016-03-22 17:06:00 711

原创 【SDUT2414】An interesting game——最小费用

题目描述 Xiao Ming recently designs a little game, in front of player there are N small hillsides put in order, now Xiao Ming wants to increase some hillsides to block the player, so he prepared another M

2016-03-20 20:52:00 513

原创 【SDUT2416】Fruit Ninja II——积分

Fruit Ninja II题目描述Have you ever played a popular game named “Fruit Ninja”?Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for Nvidia Tegra 2 based Android devices) is a video game

2016-03-20 19:58:48 505

原创 【SPOJ375】 Query on a tree——树链剖分

You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3…N-1.We will ask you to perfrom some instructions of the following form:CHANGE i ti : change the cos

2016-03-20 19:49:56 448

原创 【POJ1204】Word Puzzles——AC自动机

Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 10594 Accepted: 4002 Special Judge DescriptionWord puzzles are usually simple and very entertaining for all ages. They are

2016-03-19 09:29:50 603

原创 【HDU2896】病毒侵袭——AC自动机基础

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋——我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路上总有那么些网站

2016-03-17 20:55:15 415

原创 【HDU2222】Keywords Search——AC自动机基础

Keywords SearchTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Problem Description In the modern time, Search engine came into the life of everybody like Google, B

2016-03-17 19:37:57 526

原创 【POJ2750】Potted Flower——线段树

Time Limit: 2000MS Memory Limit: 65536K DescriptionThe little cat takes over the management of a new park. There is a large circular statue in the center of the park, surrounded by N pots of flow

2016-03-17 18:19:49 396

原创 【POJ2886】Who Gets the Most Candies?-线段树+反素数

Time Limit: 5000MS Memory Limit: 131072K Case Time Limit: 2000MSDescriptionN children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of th

2016-03-05 16:55:16 424

原创 【HDU2255】奔小康赚大钱-KM算法

Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子

2016-03-04 19:54:34 497

原创 Manthan, Codefest 16 -C. Spy Syndrome 2

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output After observing the results of Spy Syndrome, Yash realised the errors of his w

2016-03-03 15:42:16 693

原创 Topcoder SRM 683 Div2 B

贪心的题,从左向右推过去即可#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include

2016-03-03 15:20:59 589

原创 Topcoder SRM 683 Div2 - C

树形Dp的题,根据题意建树。DP[i][0] 表示以i为根节点的树的包含i的时候的所有状态点数的总和Dp[i][1] 表示包含i结点的状态数目对于一个子节点vDp[i][0] = (Dp[v][1]+1)*Dp[i][0]+Dp[v][0]*Dp[i][1]表示子节点的所有状态与i的所有的状态之间的组合(可以不组合,所以DP[v][1]+1),接下来更新i的状态数目DP[i][1] = Dp[i][

2016-03-03 15:18:21 664

原创 Manthan, Codefest 16 -B. A Trivial Problem

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mr. Santa asks all the great programmers of the world to solve a trivial probl

2016-03-02 20:53:12 499

原创 Manthan, Codefest 16 -A Ebony and Ivory

time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Dante is engaged in a fight with “The Savior”. Before he can fight it with his

2016-03-02 20:48:20 389

OCLSDKLightAMD.zip

替代AMD APP SDK的OpenCL的库。OpenCL(全称Open Computing Language,开放运算语言)是第一个面向异构系统通用目的并行编程的开放式、免费标准,也是一个统一的编程环境,便于软件开发人员为高性能计算服务器、桌面计算系统、手持设备编写高效轻便的代码

2019-10-15

MakedownTyproa

Typroa 终于有Linux 版了

2016-12-20

算法合集之最小割模型在信息学竞赛中的应用

Amber的《最小割模型在信息学竞赛中的应用》,描述了分数规划问题,最大密度子图,二分图的最小点权覆盖集与最大点权独立集

2016-02-25

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

TA关注的人

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