
比赛练习
文章平均质量分 72
努力过
喜欢coding
展开
-
poj1797 Heavy Transportation 【dijstra变形】 + HDU1010 Tempter of the Bone【DFS奇偶剪枝】
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 fro...原创 2018-05-15 00:56:44 · 269 阅读 · 1 评论 -
HZAU 1199 Little Red Riding Hood【dp】
Once upon a time, there was a little girl. Her name was Little Red Riding Hood. One day, her grandma was ill. Little Red Riding Hood went to visit her. On the way, she met a big wolf. “That's a goo...原创 2018-04-17 07:50:53 · 261 阅读 · 0 评论 -
zoj 2110+poj1562+uva439+zoj1649+zoj2165
B - Tempter of the BoneThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking.原创 2018-01-25 18:04:56 · 231 阅读 · 0 评论 -
【练习赛2补题】poj 2325 Persistent Numbers 【高精度除法+贪心】
DescriptionThe multiplicative persistence of a number is defined by Neil Sloane (Neil J.A. Sloane in The Persistence of a Number published in Journal of Recreational Mathematics 6, 1973, pp. 97-98原创 2017-08-18 22:12:46 · 465 阅读 · 0 评论 -
【练习赛2补题】zoj 2734 Exchange Cards 【DFS】
As a basketball fan, Mike is also fond of collecting basketball player cards. But as a student, he can not always get the money to buy new cards, so sometimes he will exchange with his friends for car原创 2017-08-18 17:25:57 · 282 阅读 · 0 评论 -
【比赛练习ac题】poj2253+hdu2717+poj2387+poj1258【解题报告】
A - Catch That Cow Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at原创 2017-08-17 15:14:54 · 360 阅读 · 0 评论 -
【多校连萌2】D题 ykc想吃好吃的【补题】【最大子段和变形题】
题目描述一天,ykc在学校闲的无聊,于是决定上街买点吃的,ykc很懒,本来就不是很像逛街,于是找来了czl帮他买,这里应该有滑稽,而czl也不愿为ykc买东西吃,但是ykc很强势,非让他去买,呢没办法了,然而czl还有很多事要做,没呢么多时间帮ykc,而这条小吃街又很长,有n家店,n有50000这么大,并且这n家店的商品价值有所不同(要知道,商品的价值可能为负,哈哈,很神奇吧,但是czl肯原创 2017-08-05 09:49:00 · 342 阅读 · 0 评论 -
【多校连萌2】1281: 邪能炸弹【补题】
题目描述正在入侵艾泽拉斯的古尔丹偶然间得到了一颗邪能炸弹,经过研究,他发现这是一颗威力极其巨大且难以控制的炸弹。但是精通邪能的古尔丹突然有了一个大胆的想法,他对炸弹进行了一些小小的改造。这使得炸弹需要n天的充能才能爆炸,在这n天中,每天炸弹的邪能值都会产生波动,波动值为xi,古尔丹唯一能控制的是使邪能值增加xi或减少xi,如果邪能值小于0或大于MAX,那么炸弹将会损坏并失效。机智如古尔丹当原创 2017-08-05 06:14:59 · 342 阅读 · 0 评论 -
【多校连萌2】A 简单的背包问题【补题】
1279: 简单的背包问题时间限制: 1 秒 内存限制: 32 MB提交: 363 解决: 21提交 状态 题目描述相信大家都学过背包问题了吧,那么现在我就考大家一个问题。有n个物品,每个物品有它的重量w,价值v,现在有一个容量为W的背包,问你在不超过背包容量的情况下,能装下的物品的最大价值是多少。T 1 1 1 对于每个i=2,3,…,N,原创 2017-08-04 22:57:25 · 256 阅读 · 0 评论 -
[最小生成树入门专题1] zoj1203 E - 这是水题5
#include#define N 1100#define inf 9999999int book[N],a[N],e[N][N],dis[N];int main(){int t,n,sum,count,i,j,u,min;scanf("%d",&t);while(t --){count = 0;scanf("%d",&n);for(i =原创 2017-08-02 12:05:40 · 311 阅读 · 0 评论 -
【最小生成树入门专题1】C - 这是水题3【prime】未用堆和邻接表
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,原创 2017-08-02 09:13:20 · 338 阅读 · 0 评论 -
【最小生成树入门专题1】A - 这是水题1 hihocoder hiho一下第二十六周最小生成树【prime】
描述最近,小Hi很喜欢玩的一款游戏模拟城市开放出了新Mod,在这个Mod中,玩家可以拥有不止一个城市了!但是,问题也接踵而来——小Hi现在手上拥有N座城市,且已知这N座城市中任意两座城市之间建造道路所需要的费用,小Hi希望知道,最少花费多少就可以使得任意两座城市都可以通过所建造的道路互相到达(假设有A、B、C三座城市,只需要在AB之间和BC之间建造道路,那么AC之间也是可以通过这两条道路连原创 2017-08-02 00:34:53 · 303 阅读 · 0 评论 -
【最小生成树入门专题1】G - 这是水题7 hdu1863 + B - 这是水题2 hihoCoder 1098【kruskal】
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( 行对应村庄间道路的成本,每行给出一对正整数,分别是两个原创 2017-08-02 00:29:18 · 540 阅读 · 0 评论 -
【搜索入门专题1】 hdu1242 J - Rescue c++ stl容器之优先队列+BFS
RescueProblem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is: a原创 2017-07-31 07:40:12 · 507 阅读 · 0 评论 -
【搜索入门专题1】E - Farm Irrigation 【BFS】ZOJ 2412
Farm IrrigationBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square原创 2017-07-30 17:43:48 · 255 阅读 · 0 评论 -
【搜索入门专题1】hdu2717 H - Catch That Cow 【BFS】
Catch That CowProblem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line a原创 2017-07-30 10:16:33 · 220 阅读 · 0 评论 -
【搜索入门专题1】hdu1548 G - A strange lift 【BFS】
A strange liftProblem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two bu原创 2017-07-30 09:34:35 · 268 阅读 · 0 评论 -
【搜索入门专题1】I - Knight Moves hdu1372 c++queue的应用 【BFS】
Knight MovesProblem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of原创 2017-07-29 17:35:39 · 267 阅读 · 0 评论 -
【搜索入门专题练习1】hdu1241+hdu1312 C+D【DFS】
Oil DepositsProblem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a t原创 2017-07-29 14:54:41 · 224 阅读 · 0 评论 -
【搜索入门专题练习1】hdu1010 dfs奇偶剪枝 A题
A - Tempter of the Bone原创 2017-07-29 12:22:43 · 353 阅读 · 0 评论 -
多校连萌(一)C - C UVA - 10815 【字符串】
Andy, 8, has a dream - he wants to produce hisvery own dictionary. This is not an easy task forhim, as the number of words that he knows is,well, not quite enough. Instead of thinking up allthe words原创 2017-07-29 09:20:27 · 350 阅读 · 0 评论 -
河南省多校连萌(一) E题【kruskal】
1083: [SCOI2005]繁忙的都市Description 城市C是一个非常繁忙的大都市,城市中的道路十分的拥挤,于是市长决定对其中的道路进行改造。城市C的道路是这样分布的:城市中有n个交叉路口,有些交叉路口之间有道路相连,两个交叉路口之间最多有一条道路相连接。这些道路是双向的,且把所有的交叉路口直接或间接的连接起来了。每条道路都有一个分值,分值越小表示这个原创 2017-07-29 07:40:13 · 452 阅读 · 0 评论 -
【dp专题1】hdu1087最大上升子段和 E - Super Jumping! Jumping! Jumping!
Super Jumping! Jumping! Jumping!Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know lit原创 2017-07-26 15:42:39 · 456 阅读 · 1 评论 -
【dp专题1】F - Common Subsequence 【最长公共子序列模板LCS】hdu1159
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 subsequence of X原创 2017-07-25 18:34:23 · 248 阅读 · 0 评论 -
【dp专题1】B - I NEED A OFFER! 【01背包】 hdu1203
B - I NEED A OFFER! 01背包简单的应用,求至少一份的最大概率,要注意数组的初始化和状态转移方程。数组初始化为1表示得不到offer的概率为1状态转移方程:f[j] = min( f[j] , f[j-w[i]]*(1-v[i]) )表示每次求得不到offer的最小概率。1 - 得不到offer的最小概率 = 得到至少一份offer的最大概率原创 2017-07-25 14:58:26 · 240 阅读 · 0 评论 -
练习赛2(补题)问题 G: 建设电力系统【最小生成树kruskal模板题】
问题 G: 建设电力系统题目描述小明所在的城市由于下暴雪的原因,电力系统严重受损。许多电力线路被破坏,因此许多村庄与主电网失去了联系。政府想尽快重建电力系统,所以,身为程序员的你被赋予了一项任务,就是编程计算重建电力系统的最少花费,重建的电力系统必须保证任意两个村庄之间至少存在一条通路。输入输入的第一行为一个整数T(1每组输入第一行是两个正整数N,E(2接下来的E行,每原创 2017-07-24 10:38:11 · 924 阅读 · 0 评论 -
练习赛2(补题)HDU 1058 Humble Numbers 数学题
问题 A: 丑数时间限制: 1 Sec 内存限制: 32 MB提交: 20 解决: 4[提交][状态][讨论版]题目描述如果一个数的素因子只包含2,3,5或7,那么我们把这种数叫做丑数。序列1,2,3,4,5,6,7,8,9,10,12,14,15,16,18,20,21,24,25,27...展示了前20个丑数。请你编程寻找这个序列中的第n个元素。输入输入原创 2017-07-23 18:23:11 · 517 阅读 · 0 评论 -
练习赛2(补题) 问题 C: 迷宫问题 【BFS模板题】
问题 C: 迷宫问题题目描述小明置身于一个迷宫,请你帮小明找出从起点到终点的最短路程。小明只能向上下左右四个方向移动。输入输入包含多组测试数据。输入的第一行是一个整数T,表示有T组测试数据。每组输入的第一行是两个整数N和M(1接下来N行,每行输入M个字符,每个字符表示迷宫中的一个小方格。字符的含义如下:‘S’:起点‘E’:终点‘-’:空地,可以通原创 2017-07-23 16:49:56 · 3029 阅读 · 0 评论 -
练习赛2(AC题)
问题 B: 赌徒题目描述有n个赌徒打算赌一局。规则是:每人下一个赌注,赌注为非负整数,且任意两个赌注都不相同。胜者为赌注恰好是其余任意三个人的赌注之和的那个人。如果有多个胜者,我们取赌注最大的那个为最终胜者。例如,A,B,C,D,E分别下赌注为2、3、5、7、12,最终胜者是E,因为12=2+3+7。输入输入包含多组测试数据。每组首先输入一个整数n(1接下来原创 2017-07-23 16:27:35 · 763 阅读 · 0 评论 -
练习赛1(补题)
问题 E: 一家人题目描述最近zzq交了一个新朋友叫cj,他们在聊天的时候发现500年前他们竟然是一家人!现在zzq想知道cj是他的长辈,晚辈,还是兄弟。输入输入包含多组测试数据。每组首先输入一个整数N(N输入数据保证每个人只有一个父亲。输出对于每组输入,如果cj是zzq的晚辈,则输出“You are my younger”,如果cj是zzq的长辈,则输出“Yo原创 2017-07-22 16:16:26 · 322 阅读 · 0 评论 -
练习赛1(AC题)
问题 A: 构建矩阵题目描述现请你构建一个N*N的矩阵,第i行j列的元素为i与j的乘积。(i,j均从1开始)输入输入的第一行为一个正整数C,表示测试样例的个数。然后是C行测试样例,每行为一个整数N(1输出对于每一组输入,输出构建的矩阵。样例输入214样例输出11 2 3 42 4 6 83 6 9 124 8 12 16#incl原创 2017-07-22 15:35:07 · 1701 阅读 · 0 评论 -
G - 翻翻棋 哈尔滨理工大学软件学院大一个人赛训练
象棋翻翻棋(暗棋)中双方在4*8的格子中交战,有时候最后会只剩下帅和将。根据暗棋的规则,棋子只能上下左右移动,且相同的级别下,主动移动到地方棋子方将吃掉对方的棋子。将和帅为同一级别。然而胜负在只剩下帅和将的时候已定。Input 第一行T,表示T组数据。每组数据共有四行字符串,每行字符串共八个字符’#’表示空格’*’表示红方帅’.’表示黑方将此时红方先走每组输入之间没有空行。Output 每组数据原创 2017-06-10 18:24:42 · 362 阅读 · 0 评论 -
E - 权势二进制 哈尔滨理工大学软件学院大一个人赛训练
**一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。Input 单组测试数据。 第一行给出一个整数n (1<=n<=1,000,000) Output 输出答案占一行。 Sample Input 9 Sample Output原创 2017-06-10 17:13:47 · 299 阅读 · 0 评论