自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C - Help Shahhoud (18.9.30)(字符串交换的最小次数)

Shahhoud is participating in the first Div.3 contest on Codeforces, the first problem was:Given two strings A and B of equal length N (N is odd), find the minimum number of steps needed to change A ...

2018-10-01 11:45:00 943

原创 A - Martadella Strikes Again (18.9.30)

StatementsSaeed and Shahhoud were attending a training camp for the ACM ICPC 2018 World Finals.At dinner, they were very happy to see that the meal was martadella slices! A martadella slice can be...

2018-09-30 23:45:47 353

原创 F - Random Sort (18.9.30)(全排问题,取模问题)

StatementsSaeed is teaching Algorithms 1 at Damascus University, his last lecture was about sorting algorithms. As homework, he gave the students an array A of length n and asked them to sort it in ...

2018-09-30 23:40:37 394

原创 E - Alarm Clock (尺取法)

题目链接:https://cn.vjudge.net/problem/CodeForces-898D Every evening Vitalya sets n alarm clocks to wake up tomorrow. Every alarm clock rings during exactly one minute and is characterized by one intege...

2018-09-30 12:20:48 277

原创 B - Alyona and Numbers

题目链接:https://cn.vjudge.net/problem/CodeForces-682AAfter finishing eating her bun, Alyona came up with two integers n and m. She decided to write down two columns of integers —the first column cont...

2018-09-30 10:31:21 222

原创 L - Common Subsequence (最长公共子序列)(18.9.28)

A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another sequence Z = < z1, z2, ..., zk > is a ...

2018-09-28 17:41:08 262

原创 E - Super Jumping! Jumping! Jumping! (最大递增子串和)(18.9.28)

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game ...

2018-09-28 17:22:02 131

原创 G - 免费馅饼(9.27)

G - 免费馅饼  HDU - 1176   都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里...

2018-09-27 21:43:36 426

原创 数塔(经典DP)

在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?  已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高度,接下来用N行数字表示数...

2018-09-27 21:14:37 1062

原创 I - 最少拦截系统

某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. 怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,请帮助计算一下最少需要多少套拦截系统...

2018-09-27 20:19:18 212

原创 P - The Shortest Path in Nya Graph-hdu4725(双端队列+拆点)(双向边)

来自--望月无忧--题意:有N个点和N层..一层有X个点(0<=X<=N).两邻两层间有一条路花费C。还有M条小路在两个点之间。问从第一个点走到第N个点最短路是多少...可以考虑在每一层增加一个点,这个点到上下层的距离是C,与本层的距离是0;T的很惨,不太明白为什么,翻了一下大神的博客,发现这个要把每层拆成两个点来算的,要是只拆成一个点那么本层到本层的点都会是0了时间卡的很...

2018-09-27 17:31:30 208 1

原创 O - Extended Traffic(判断负环)(spfa)(邻接表)

题意:有n个城市,每一个城市有一个拥挤度ai,从一个城市I到另一个城市J的时间为:(aJ-aI)^3,存在负环。问从第一个城市到达第k个城市所话的时间,如果不能到达,或者时间小于3输出?否则输出所花的时间。。这道题存在负环,而且所以要求出来所有负环(包括负环能到达的位置),若大于点N,说明不能到达,可以用进队列的次数来判断Dhaka city is getting crowded and ...

2018-09-27 16:41:05 186

原创 dfgdfs

 #include <bits/stdc++.h>using namespace std;const int inf=0x3f3f3f;int main(){ int t;scanf("%d",&t); int s1=0,s2=0; long long sum=0; int x,n; cha...

2018-09-26 09:14:37 748

原创 L - PC is for kicking

StatementsOtvio is a calm guy with a guilty pleasure: kicking PCs. Now he is participating in a programming competition where the computers are arranged as a tree, that is, the NPCs are connected by...

2018-09-26 00:05:18 518

原创 B - Ignatius and the Princess IV

"OK, you are not too bad, em... But you can never pass the next test." feng5166 says. "I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to te...

2018-09-25 08:19:26 190

原创 Max Sum Plus Plus

Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Given...

2018-09-24 21:03:57 129

原创 大砍刀

大牛:https://blog.csdn.net/liuqiyao_01/article/details/9079611

2018-09-24 16:50:36 326

原创 B - Dungeon Master

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south...

2018-09-24 00:15:53 160

原创 A - 棋盘问题

在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n...

2018-09-23 22:39:48 184

原创 K - Candies(用栈 求最短路,邻接表)

During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the...

2018-09-22 23:50:04 203

原创 最短路径中的最大值(模板)

#include<stdio.h>#include<string.h>#include<algorithm>#include<stdlib.h>using namespace std;const int N=1005;const int inf=0x3f3f3f;int n;int vis[N];int mp[N][N];int...

2018-09-22 00:20:26 1547

原创 懂我(持续更新中。。。)

atoi(s)函数用于把一个字符串转换为一个整型数据,该函数定义在stdlib.h中#include<iostream.h> #include<stdlib.h> int main(){ char s[100]; int b; gets(s);b=atoi(s); cout<<b<<endl;return 0; ...

2018-09-21 23:18:49 114

原创 N - Tram

Tram network in Zagreb consists of a number of intersections and rails connecting some of them. In every intersection there is a switch pointing to the one of the rails going out of the intersection. ...

2018-09-21 00:06:17 213

原创 J - Invitation Cards

In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They ...

2018-09-20 23:22:09 146

原创 I - Arbitrage

Arbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar buys 0.5 Britis...

2018-09-20 21:35:08 149

原创 H - Cow Contest

N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is un...

2018-09-20 20:52:25 107

原创 G - MPI Maelstrom

题目大意:BIT最近要取会他们的超级计算机,32处理器阿波罗奥德赛与分层通信子系统分布式共享内存的机器(听着很高端大气),瓦伦丁*麦基的顾问杰克*斯威特告诉她基准测试的新系统。(没有明白什么意思)“因为阿波罗是一个分布的共享内存的机器,内存的访问和交流通信的时间是不统一的”瓦伦丁告诉斯威特。。。。。。(受不了了,这什么破英语,又臭又长还对话!!!!)直接说这道题的意思算求,就是给一个临街矩...

2018-09-20 20:16:13 327

原创 G - MPI Maelstrom (18.9.20)(最短路中的最大值)

 BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee's research a...

2018-09-20 19:49:03 339

原创 F - Wormholes (18.9.20)

农夫约翰在探索他的许多农场,发现了一些惊人的虫洞。虫洞是很奇特的,因为它是一个单向通道,可让你进入虫洞的前达到目的地!他的N(1≤N≤500)个农场被编号为1..N,之间有M(1≤M≤2500)条路径,W(1≤W≤200)个虫洞。FJ作为一个狂热的时间旅行的爱好者,他要做到以下几点:开始在一个区域,通过一些路径和虫洞旅行,他要回到最开时出发的那个区域出发前的时间。也许他就能遇到自己了:)。为了帮助...

2018-09-20 17:08:52 160

原创 畅通工程续 HDU - 1874

题目链接:https://cn.vjudge.net/problem/HDU-1874 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请...

2018-09-20 01:50:56 104

原创 E - Straight Shot

题目链接: https://odzkskevi.qnssl.com/3b068390f8a2f00b5e1927f3e846ed02?v=1536723186  #include <iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include...

2018-09-19 23:48:35 178

原创 Problem L — limit 1 second Delayed Work

 题目链接:https://odzkskevi.qnssl.com/3b068390f8a2f00b5e1927f3e846ed02?v=1536723186#include <iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math...

2018-09-19 23:10:17 176

原创 Problem A — limit 1 second Odd Palindrome

题目链接: https://odzkskevi.qnssl.com/3b068390f8a2f00b5e1927f3e846ed02?v=1536723186 #include <iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>using namespa...

2018-09-19 22:54:52 153

原创 B. Badge

题目链接:http://codeforces.com/problemset/problem/1020/B B. Badgetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Summer Informat...

2018-09-19 09:22:11 212

原创 D - Silver Cow Party

题目链接:https://cn.vjudge.net/contest/254819#problem/D One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A t...

2018-09-19 08:41:43 311

原创 K - Zigzag(尺取法)

Statements题目链接:https://cn.vjudge.net/contest/254692#problem/KA sequence is called "Zigzag" if no three of its consecutive elements are monotone.More formally, if sequence A of length N is Zigzag...

2018-09-19 00:38:22 214

原创 C - Heavy Transportation(18.9.18)

Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his cus...

2018-09-18 17:06:58 130

原创 B - Frogger

Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sun...

2018-09-18 12:49:46 137

原创 A - Til the Cows Come Home (18,9,18)

Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get b...

2018-09-18 10:41:51 141

原创 顺序表应用7:最大子段和之分治递归法

顺序表应用7:最大子段和之分治递归法Time Limit: 10 ms Memory Limit: 400 KiBSubmit StatisticProblem Description 给定n(1<=n<=50000)个整数(可能为负数)组成的序列a[1],a[2],a[3],…,a[n],求该序列如a[i]+a[i+1]+…+a[j]的子段和的最大值。当所给的整数均为...

2018-09-18 09:46:11 147

空空如也

空空如也

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

TA关注的人

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