自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 HDU1025 最长上升子序列(nlogn算法) DP

Constructing Roads In JGShining’s KingdomTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3938 Accepted Submission(s): 1119Problem Descript...

2019-01-29 00:56:21 120

原创 HDU - 1078

HDU 1078FatMouse and CheeseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2812 Accepted Submission(s): 1089Problem DescriptionFatMouse has st...

2019-01-29 00:50:21 105

原创 HDU1072-Nightmare【广度优先搜索】

NightmareTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7069 Accepted Submission(s): 3397Problem DescriptionIgnatius had a nightmare las...

2019-01-29 00:48:50 107

原创 POJ1251Jungle Roads(最小生成树)

The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so...

2019-01-29 00:47:24 87

原创 hdu - 1754 - I Hate It(线段树(单点更新))

很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 )...

2019-01-29 00:45:15 70

原创 uva11389

题目大意:有n个司机,下午路线和晚上路线,现在要分别分配一条下午路线一条晚上路线给一个司机。要使得加班费最少。只要驾车时间超过d,那么多余部分一小时r元。思路:下午最小和晚上最大搭配。贪心。代码:#include <iostream>using namespace std;#include <stdio.h>#include <algorithm&gt...

2019-01-29 00:40:42 69

原创 HDU1026 bfs

Problem DescriptionThe Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166’s castle. The castle is a large labyrinth. ...

2019-01-28 23:27:49 65

转载 HDU 1213 How Many Tables (并查集,连通分支数,两种方式)

How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23012 Accepted Submission(s): 11485Problem DescriptionToday is Ignatius’ b...

2019-01-28 23:25:26 73

原创 hdu 1560 DNA sequence(迭代加深搜索)

DNA sequenceTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1296 Accepted Submission(s): 648Problem DescriptionThe twenty-first century ...

2019-01-28 23:21:52 81

原创 hdu 1264 线段树+扫描线

Your input is a series of rectangles, one per line. Each rectangle is specified as two points(X,Y) that specify the opposite corners of a rectangle. All coordinates will be integers in the range 0 to ...

2019-01-28 23:20:05 111

原创 hdu 1255

覆盖的面积Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5019 Accepted Submission(s): 2515Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积....

2019-01-28 21:13:39 94

转载 POJ3268 (单源最短路径)

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 total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roa...

2019-01-28 21:05:50 137

原创 poj 1860 Currency Exchange (最短路)

Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 17745 Accepted: 6262DescriptionSeveral currency exchange points are working in our city. Let us suppose that each poi...

2019-01-28 20:57:01 94

原创 HDU2870 最大窗口面积(单调队列优化)

Now here is a matrix with letter ‘a’,‘b’,‘c’,‘w’,‘x’,‘y’,‘z’ and you can change ‘w’ to ‘a’ or ‘b’, change ‘x’ to ‘b’ or ‘c’, change ‘y’ to ‘a’ or ‘c’, and change ‘z’ to ‘a’, ‘b’ or ‘c’. After you chan...

2019-01-28 00:06:48 85

原创 HDU-2830 动态规划

Given an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entries are all 1, and we define the maximum area of such rectangle as this matrix’s goodness.We...

2019-01-28 00:05:05 68

原创 UVA11624 Fire! 两次BFS

Fire!Joe works in a maze. Unfortunately,portions of the maze have caught on fire, and the owner of the maze neglectedto create a fire escape plan. Help Joe escape the maze.Given Joe’s location in th...

2019-01-28 00:03:48 80

原创 POJ 3984 迷宫问题

迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8154 Accepted: 4804Description定义一个二维数组:int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0...

2019-01-27 23:59:06 66

原创 hdu 1176 免费馅饼(DP)

免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 37976 Accepted Submission(s): 12977Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,...

2019-01-27 23:56:22 56

原创 POJ-1611-The Suspects (简单并查集!)

Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to s...

2019-01-27 23:51:07 86

原创 poj 3414 Pots 广搜BFS+路径输出

转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents题目链接:http://poj.org/problem?id=3414此题和poj1606一样 :http://blog.csdn.net/u012860063/article/details/37772275DescriptionYou are given two pots,...

2019-01-27 23:46:30 115

原创 HDU - 3533 BFS

The students of the HEU are maneuvering for their military training.The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red army, so Little A has to e...

2019-01-27 23:44:44 99

原创 UVA424高精度加法

One of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration ofpowers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.“This supercompu...

2019-01-27 23:32:26 113

原创 UVA - 410 贪心

The International Space Station contains many centrifuges in its labs. Each centrifuge will have some number © of chambers each of which can contain 0, 1, or 2 specimens. You are to write a program wh...

2019-01-27 23:22:49 126

原创 HDU - 2068 错排加组合数

Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;…可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生越来越多,我...

2019-01-25 23:15:52 67

原创 HDU 2191 多重背包加二进制

悼念512汶川大地震遇难同胞——珍惜现在,感恩生活Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 40121 Accepted Submission(s): 16974Problem Description急!灾区的食物依然短缺!为了挽...

2019-01-25 23:12:34 89

原创 HDU 1301 最小生成树

Problem DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes r...

2019-01-25 23:07:26 46

原创 15周第三题

题意:给你一个缺少后两位的数和一个整数,知道前面的数被另一个整数除尽了,问后两位数是多少。思路:用for循环逐一判断 符合就输出int main(){int n, m, i;int a[10010], t = 0;while (cin >> n >> m){t = 0;memset(a, 0, sizeof(a));if (n == 0 &&am...

2018-12-14 17:42:28 75

原创 15周 第二题

总长n,每秒走u,下降d因为要下降 相当与每两秒走 u-d计算n-u 要走的时间最后加1就行了#include<stdio.h>#includeusing namespace std;int main(){int n, u, d;while (cin>>n>>u>>d){int t = (n - u) / (u - d);i...

2018-12-14 17:41:15 60

原创 15周 第一题

01 背包问题 并不懂#include#includeusing namespace std;int dp[4][40000];int main(){int i, j, n;memset(dp, 0, sizeof(dp));dp[0][0] = 1;for (i = 1; i <= 3; i++) {for (j = 0; j < 32770; j++) {d...

2018-12-14 17:40:44 68

原创 HDU-2027

统计每个元音字母在字符串中出现的次数。Input输入数据首先包括一个整数n,表示测试实例的个数,然后是n行长度不超过100的字符串。Output对于每个测试实例输出5行,格式如下:a:num1e:num2i:num3o:num4u:num5多个测试实例之间由一个空行隔开。请特别注意:最后一块输出后面没有空行:)Sample Input2aeioumy name is ...

2018-12-11 18:05:08 66

原创 HDU-6292

著名出题人小Q每次比赛后都会写一份《赛题分析》,包含比赛概况、每题的参考算法以及一些统计数值。对于一道题来说,小Q会统计最短的验题人代码长度(Shortest judge solution)以及赛内参赛队伍最短的AC代码长度(Shortest team solution)。统计验题人代码长度比较容易,因为验题人最多也不会超过2020个。但是统计选手代码长度就不容易了,因为大赛区动辄三四百支队伍...

2018-12-11 18:03:01 180

原创 CodeForce-4A

One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w ki...

2018-12-11 18:00:45 89

原创 [HDU-2039]

给定三条边,请你判断一下能不能组成一个三角形。Input输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000;Output对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。Sample Input21 2 32 2 2Sample OutputNOYEShttps://paste.ubu...

2018-12-11 17:58:05 83

原创 第八题

08解题思路在输出之前加个判断就好了#includeusing namespace std;int main(){int a, b;while (cin >> a >> b){int sum;cout &

2018-12-07 19:46:15 105

原创 第七题

07解题思路用While逐行输入 用pringtf保留3位小数#include #include <math.h>#include<stdio.h>#define PI 3.1415927using namespace std;int main(){double r, v;while (cin >&a

2018-12-07 19:45:52 76

原创 第六题

06 解题思路用sort排序 输出#include#include < algorithm>using namespace std;int main(){char b[3];while (cin >> b){ sort(b, b + 3); cout << b[0] &a

2018-12-07 19:45:28 60

原创 第五题

https://paste.ubuntu.com/p/fH4t3TF5Mk/05解题思路用gets_s获取数组用strtok分割并放进数组a[]C++用sort排序a[]#include #include #include <stdio.h>#include <stdlib.h>#include <string.h>using nam

2018-12-07 19:44:21 90

原创 第四题

04考虑到有很多行用while函数 当这行为为空结束输出和#includeusing namespace std;int main(){int a, b;while (cin >> a >> b){cout << a + b;system(“pause”);}}...

2018-12-07 18:56:46 134

原创 第三题

03https://paste.ubuntu.com/p/8mHzh3QzTQ/解题思路建立数组比较两两之间相同与否就行了#includeusing namespace std;int main(){int num;char a[100];cin >> num;cin >> a;int n = 0;for (int i = 0; i < n...

2018-12-07 18:55:01 55

原创 第二题

https://paste.ubuntu.com/p/8GnWdmFGhf/02解题思路:输入第一行整数n建立p,qfor循环逐行计算 累加到ans输出ans#includeusing namespace std;int main() {int n;int p, q;cin >> n;int ans = 0;for(int a=n;n>0;n–){...

2018-12-07 18:54:17 79

空空如也

空空如也

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

TA关注的人

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