
ACM
文章平均质量分 51
csx0987
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Saruman's_Army
DescriptionSaruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the原创 2015-05-09 11:07:24 · 328 阅读 · 0 评论 -
ACM-迷宫的最短路径(bfs版)
//给定一个大小为N*M的迷宫,迷宫由通道和墙壁组成,每一步可以向邻接//的上下左右四格的通道移动。请求出从起点到终点的最小部署,本题假设//从起点一定可以移动到终点//input// N=10,M=10//#S######.#//......#..#//.#.##.##.#//.#........//##.##.####//....#....#//.#######.#//原创 2015-05-03 20:08:58 · 3328 阅读 · 0 评论 -
ACM-硬币问题
//有1元,5元,10元。50元,100元,500元的硬币各C1,C5,C10,C100//C500枚。现在要用这些硬币来支付A元,最少需要多少枚硬币?假定//本题至少存在一种支付方案//input// C1=3,C5=2,C10=1,C50=3,C100=0,C500=2,A=620//output// 6#include "cstdio"int C[6];const in原创 2015-05-03 20:18:51 · 1386 阅读 · 0 评论 -
ACM-迷宫最短路径(dfs版)
//给定一个大小为N*M的迷宫,迷宫由通道和墙壁组成,每一步可以向邻接//的上下左右四格的通道移动。请求出从起点到终点的最小部署,本题假设//从起点一定可以移动到终点//input// N=10,M=10//#S######.#//......#..#//.#.##.##.#//.#........//##.##.####//....#....#//.#######.#//原创 2015-05-03 20:16:51 · 2019 阅读 · 1 评论 -
ACM-Ants
//n只蚂蚁以每秒1cm的速度在长为Lcm的竿子上爬行。蚂蚁到端点时会掉落,两只蚂蚁相遇时,不能交错通过,只能各自反向爬回去。//我们知道它距离竿子左端的距离xi,但不知道它当前的方向。请计算所有蚂蚁落下竿子所需的最短时间和最长时间//input// L=10// n=3// x=[2,6,7]//output// min=4// max=8#include "iostream原创 2015-05-03 19:54:31 · 540 阅读 · 0 评论 -
ACM-抽签(二分搜索)
//将写有数字的n个纸片放入口袋,有放回抽取4次,4次数字的总和是否会等于m//input//n=3//m=10//k={1,3,5}////output//Yes//#include "iostream"#include "algorithm"using namespace std;const int MAX_N=1000;int n,m;int k[MAX_N]原创 2015-05-03 19:46:01 · 772 阅读 · 0 评论 -
ACM-区间调度问题
//有m项工作每项工作分别在Si时间开始,在Ti时间结束。//对于每项工作你都可以选择参与与否。如果选择参与//那么自始至终都必须全程参与,此外参与工作的时间端不能//重叠(即使是开始的瞬间的重叠也是不允许的)//input//n=5//s={1,2,4,6,8}//t={3,5,7,9,10}//output//3#include "cstdio"#include "原创 2015-05-03 21:29:55 · 1037 阅读 · 0 评论 -
ACM-部分和问题
//给定整数a1,a2,a3........判断是否可以从中选出若干数,使它们的和恰好为k//input// n=4// a={1,2,4,7}// k=13#include "iostream"using namespace std;const int MAX_N=1000;int n,k;int a[MAX_N];bool dfs(int i,int sum){原创 2015-05-03 19:56:10 · 670 阅读 · 0 评论 -
ACM-三角形
//有n根棍子,棍子i的长度为ai,从中取出3根绳子组成周长最大的三角形,并输出周长,无法组成则输出0//input// n=5// a={2,3,4,5,10}//output// 12#include "iostream"using namespace std;const int MAX_N=1000;int n,a[MAX_N];int max(int a,int原创 2015-05-03 19:49:48 · 632 阅读 · 0 评论 -
Best_Cow_Line
DescriptionFJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line and herds them past the judges.T原创 2015-05-09 10:50:27 · 522 阅读 · 0 评论 -
Fence_Repair
DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer len原创 2015-05-09 12:50:04 · 385 阅读 · 0 评论 -
ACM-LakeCounting
//有一个大小为N*M的园子,雨后积起了水。八连通的积水被认为是连接在一起的。请求出园子里总共有多少水洼?//input// N=10,M=12//W........WW.//.WWW.....WWW//....WW...WW.//.........WW.//.........W..//..W......W..//.W.W.....WW.//W.W.W.....W.//.W.原创 2015-05-03 20:02:23 · 982 阅读 · 0 评论