自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2017 HDU 6140 多校联合赛 Hybrid Crystals

Kyber crystals, also called the living crystal or simply the kyber, and known as kaiburr crystals in ancient times, were rare, Force-attuned crystals that grew in nature and were found on scattered pla

2017-08-18 16:03:50 323

原创 2017 HDU 6105 多校联合赛 Gameia

Alice and Bob are playing a game called ‘Gameia ? Gameia !’. The game goes like this : 0. There is a tree with all node unpainted initial. 1. Because Bob is the VIP player, so Bob has K chances to

2017-08-14 10:51:40 421

原创 2017 HDU 6103 多校联合赛 Kirinriki

We define the distance of two strings A and B with same length n is dis(A,B)= ∑ (i=0→n−1) abs (Ai−Bn−1−i)The difference between the two characters is defined as the difference in ASCII. You should fin

2017-08-14 09:39:25 456

原创 2017 HDU 6092 多校联合赛 Rikka with Subset

As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them: Yuta has nn positive A1−An and their sum is m. Then for ea

2017-08-10 10:04:02 421

转载 百度之星资格赛1003 度度熊与邪恶大魔王

Problem Description度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗起来。邪恶大魔王的麾下有n个怪兽,每个怪兽有a[i]的生命值,以及b[i]的防御力。度度熊一共拥有m种攻击方式,第i种攻击方式,需要消耗k[i]的晶石,造成p[i]点伤害。当然,如果度度熊使用第i个技能打在第j个怪兽上面的话,会使得第j个怪兽的生命值减少p[i]-b[j],当然如果伤害小于防御,那么攻击就不会奏效。如

2017-08-05 15:01:09 1951

原创 2017 HDU 6058 多校联合赛 Kanade's sum

Give you an array A[1..n] of length n . Let f(l,r,k) be the k-th largest element of A[l..r]. Specially , f(l,r,k)=0 if r−l+1< k Give you k , you need to calculate ∑(l =1 to n)∑(r = l

2017-08-02 16:36:13 626

原创 2017 HDU 多校联合赛 Colorful Tree

There is a tree with nn nodes, each of which has a type of color represented by an integer, where the color of node ii is cici. The path between each two different nodes is unique, of which we define t

2017-08-02 09:22:35 359

原创 2017 HDU 多校联合赛 Regular polygon

On a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make.InputThe input file consists of several test cases. Each case

2017-07-28 15:53:02 471

原创 2017 HDU 多校联合赛 Balala Power!

alented Mr.Tang has nn strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 2

2017-07-26 17:23:11 567

原创 山东省第八届ACM省赛A题

Problem DescriptionSherlock and Watson are playing the following modified version of Nim game: There are n piles of stones denoted as ,,…,, and n is a prime number; Sherlock always plays first, and W

2017-07-24 19:03:21 584

原创 山东省第八届ACM省赛C题

Problem DescriptionHmz likes to play fireworks, especially when they are put regularly. Now he puts some fireworks in a line. This time he put a trigger on each firework. With that trigger, each firew

2017-07-24 10:37:25 557

原创 POJ 1125 最短路的水题

#include<cstdio>#define MAX 0x3f3f3f3fusing namespace std;int main(){ int m; //printf("几组数据\n"); //scanf("%d",&n); while(scanf("%d",&m)!=EOF&&m!=0) { int min3=MAX;

2017-03-09 21:22:54 376

转载 最短路径—Dijkstra算法和Floyd算法

该文章转自: 博客园 华山大师兄 文章链接:http://www.cnblogs.com/biyeymyhjob/archive/2012/07/31/2615833.html注意:以下代码 只是描述思路,没有测试过!!Dijkstra算法1.定义概览Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层

2017-03-09 21:18:52 346

原创 最短路问题 (Dijkstra 迪杰斯特拉算法)

可以照图输入数据进行验证从1到6的最短路为 9 依然是朴素的代码///最短路(Dijkstra 迪杰斯特拉算法) ***该算法中不能出现负权值***#include<cstdio>#define MAX 0x3f3f3f3fusing namespace std;int main(){ int n; scanf("%d",&n);

2017-03-09 21:08:16 712

原创 畅通工程 最小生成树

问题:某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? 输入:测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正整数,分

2017-03-07 20:11:53 375

原创 Doing Homework again 贪心算法

问题:Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after

2017-03-05 19:46:56 557

原创 字符串匹配 KMP算法 模版

问题:给定两个字符串a、b,求b在a中出现的位置。输入:第一行为一个字符串a,长度大于等于1小于等于100000。 第二行为一个字符串b,长度大于等于1小于等于1000。输出:一个整数,b在a中出现的位置,若b不是a的字串,输出-1。样例:abababc ababc3十分简单朴素的代码 没有问题分析,只有代码理解,请百度完问题分析后,来进行代码理解PS:该代码只能求出第一次匹配时的字符位置

2017-03-01 20:13:46 441

原创 完全背包 动态规划 模版

问题:XXX上山去采药。XXX有一个容量为m(1<=m<=1000)的背包,他所采集的药材的总重量不能大于背包的容量。已知共有n(1<=n<=1000 )种药材,每种药材都有无限多,并且知道每种药材的重量w(1<=w<=m)及价值v(1<=v<=100000),如何选择,才能使得采到的药材的总价值最大?输入:第1行为两个整数m和n,分别为背包的容量及药材的种数。 第2至n+1行每行两个整数w和v,分

2017-02-28 20:40:11 455

原创 CD收藏 并查集 模版

问题:lmh平常爱听歌,所以买了很多的CD来收藏,但是因为平常整理不当,所以忘记了这些CD的歌手是谁。现在他想知道他到底收藏了多少位歌手的专辑,于是他想了一个办法,同时拿出两个CD来听,可以分辨出来是否为同一个歌手唱的。(如果没有说明则认为是没有分辨出来,为不同歌手)现在他列了一个表记录哪些专辑是同一歌手,但他面对着这一堆记录不知如何处理,请你告诉他到底他有多少个歌手的专辑。输入:第一行n,m。n表

2017-02-28 19:52:52 402

原创 01背包采药问题 模版

最基本的动态规划问题 这里只是放一下代码和部分注释,问题解析请参考其他人的分析 此代码比较朴素易懂///01背包采药模版 动态规划#include<cstdio>#include<cstring>using namespace std;int max(int x,int y) ///先自己编写一个简单的max函数

2017-02-28 19:45:36 336

原创 01背包模版

01背包问题#include<cstdio>#include<cstring>using namespace std;int maxs(int x,int y){ if(x>y) return x; else return y;}int main(){ int T,N; scanf("%d

2017-02-26 21:22:32 240

空空如也

空空如也

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

TA关注的人

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