乐逍遥xwl

导航

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页

2019年6月6日 #

next_permutation 函数

摘要: STL的next_permutation函数可以求出某个特定序列的下一个排列,当然,如果对一个给定序列,排序之后可以轻松求出全排列...... 阅读全文

posted @ 2019-06-06 19:47 乐逍遥xwl 阅读(141) 评论(0) 推荐(0) 编辑

2019年6月3日 #

POJ 3268 (dijkstra算法)

摘要: Silver Cow Party Description 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 阅读全文

posted @ 2019-06-03 20:17 乐逍遥xwl 阅读(191) 评论(0) 推荐(0) 编辑

POJ 3264 (线段树)

摘要: Balanced Lineup Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides 阅读全文

posted @ 2019-06-03 19:57 乐逍遥xwl 阅读(144) 评论(0) 推荐(0) 编辑

2019年5月28日 #

TaoTao要吃鸡 (01背包)

摘要: TaoTao要吃鸡 题目描述 Taotao的电脑带不动绝地求生,所以taotao只能去玩pc版的荒野行动了, 和绝地求生一样,游戏人物本身可以携带一定重量m的物品,装备背包 之后可以多携带h(h为0代表没有装备背包)重量的东西。玩了几天 taotao发现了一个BUG,当装备背包之后,如果可携带重量没 阅读全文

posted @ 2019-05-28 19:24 乐逍遥xwl 阅读(223) 评论(0) 推荐(0) 编辑

2019年5月27日 #

兑换零钱 (dp)

摘要: 兑换零钱 题目描述 现有N元钱,兑换成小额的零钱,有多少种换法?币值包括1 2 5分,1 2 5角,1 2 5 10 20 50 100元。 (由于结果可能会很大,输出Mod 10^9 + 7的结果) 输入 输入描述: 第一行输入一个整数T,代表有T组数据接下来T行,每行输入1个数N,N = 100 阅读全文

posted @ 2019-05-27 20:55 乐逍遥xwl 阅读(307) 评论(0) 推荐(0) 编辑

hdu 2602 (01背包)

摘要: Bone Collector Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect vari 阅读全文

posted @ 2019-05-27 20:45 乐逍遥xwl 阅读(132) 评论(0) 推荐(0) 编辑

2019年5月24日 #

Big Water Problem (线段树)

摘要: Big Water Problem 题目描述 给一个数列,会有多次询问,对于每一次询问,会有两种操作: 1:给定两个整数x, y, 然后在原数组的第x位置上加y; 2:给定两个整数l,r,然后输出数组从第l位加到第r位数字的和并换行 输入描述: 第一行有两个整数n, m(1 <= n, m <= 1 阅读全文

posted @ 2019-05-24 12:50 乐逍遥xwl 阅读(260) 评论(0) 推荐(0) 编辑

2019年5月23日 #

POJ 3468 (线段树)

摘要: 题目链接:http://poj.org/problem?id=3468 You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of operation is to 阅读全文

posted @ 2019-05-23 20:09 乐逍遥xwl 阅读(130) 评论(0) 推荐(0) 编辑

2019年5月22日 #

图的最小生成树 (并查集)

摘要: 道路建设 题目描述 随着如今社会的不断变化,交通问题也变得越来越重要,所以市长决定建设一些公路来方便各个城市之间的贸易和交易。虽然市长的想法很好,但是他也遇到了一般人也经常头疼的问题,那就是手头的经费有限……在规划过程中,设计师们已经预算出部分城市之间建设公路的经费需求。现在市长想知道,它能不能将他 阅读全文

posted @ 2019-05-22 20:42 乐逍遥xwl 阅读(325) 评论(0) 推荐(0) 编辑

2019年5月19日 #

C - News Distribution (并查集)

摘要: C. News Distribution C. News Distribution Example input 7 5 3 2 5 4 0 2 1 2 1 1 2 6 7 output 4 4 1 4 4 2 2 思路:简单来讲,就是用并查集求每个点所在连通块的大小,有两种写法......写法一:用 阅读全文

posted @ 2019-05-19 20:16 乐逍遥xwl 阅读(239) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页