- 博客(5)
- 收藏
- 关注
原创 算法训练 和为T
问题描述 从一个大小为n的整数集中选取一些元素,使得它们的和等于给定的值T。每个元素限选一次,不能一个都不选。 输入格式 第一行一个正整数n,表示整数集内元素的个数。 第二行n个整数,用空格隔开。 第三行一个整数T,表示要达到的和。 输出格式 输出有若干行,每行输出一组解,即所选取的数字,按照输入中的顺序排列。 若有多组解,优先输出不包含第n个整数的;若都包含或都不包含,优先输出不包含第n-1个整...
2020-02-29 23:04:16 244
原创 A Strange Lift(简单BFS)
There 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 buttons: up and down.When you at floor i,if...
2020-02-29 14:19:53 116
原创 Intersecting Dates 日期问题
问题描述 研究组正在开发一个计算机程序,这个程序会从一个服务获得历史股票市场价格数据。而这个服务每提供一天的股市数据,都要收取一个固定的费用。这个研究组检查了过去请求的价格数据,发现有着大量的重复,也就浪费了不少的研究经费。所以新的程序需要维护一个表来保存研究组成员曾经请求过的所有价格数据。当需要一段新的价格数据时,只有曾经没有请求过的会从服务获得,从而减少研究开销。 你的任务是完成一个程序来判断...
2020-02-29 14:19:01 326
原创 Prime Path(广度优先搜索bfs)
Prime Path The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a ma...
2020-02-18 22:46:08 122
原创 Catch That Cow(广度优先搜索)
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 a ...
2020-02-18 21:01:26 159
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人