- 博客(9)
- 收藏
- 关注
原创 2019牛客暑期多校训练营(第六场)J Upgrading Technology
链接:https://ac.nowcoder.com/acm/contest/886/J 来源:牛客网 Rowlet is playing a very popular game in the pokemon world. Recently, he has encountered a problem and wants to ask for your help. In this game, ...
2019-08-05 10:03:52
171
原创 [kuangbin带你飞]专题2 搜索进阶 A - Eight
The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed...
2019-08-02 16:49:37
232
原创 牛客多校(第四场) D:triples I
链接:https://ac.nowcoder.com/acm/contest/884/D 来源:牛客网 题目描述 Doctor Elephant is testing his new program: output the bitwise or of the numbers inputed. He has decided to input severalmultiples of 3 a...
2019-07-28 16:44:58
184
原创 删除数字
题目描述 小明最近在研究一个数字删除游戏,正要考考佳佳。游戏规则如下 给定一个正整数,去掉其中若干个数字后剩下的数字按原左右次序将组成一个新的正整数。请问最少删去几个数字,能够使得这个新的正整数合法(不含前导0)且是3的倍数。 小明写下的数字太大,佳佳一时处理不了。请你帮他写一个程序处理出结果吧! 输入 第一行一个整数n,表示小明写下了n正整数 第2~n+1行每行一个正整数Ai ...
2018-10-30 10:30:00
1098
原创 Candy Distribution Again
There are N children, numbered 1,2,…,N. Snuke has decided to distribute x sweets among them. He needs to give out all the xsweets, but some of the children may get zero sweets. For each i (1≤i≤N), C...
2018-10-16 09:29:29
248
原创 扩展二叉树
题目描述 由于先序、中序和后序序列中的任一个都不能唯一确定一棵二叉树,所以对二叉树做如下处理,将二叉树的空结点用·补齐,如图所示。我们把这样处理后的二叉树称为原二叉树的扩展二叉树,扩展二叉树的先序和后序序列能唯一确定其二叉树。现给出扩展二叉树的先序序列,要求输出其中序和后序序列。 输入 输入扩展二叉树的先序序列 输出 输出其中序和后序序列 样例输入 ...
2018-08-11 15:03:42
260
转载 营救(广搜练习)
铁塔尼号遇险了!他发出了求救信号。距离最近的哥伦比亚号收到了讯息,时间就是生命,必须尽快赶到那里。 通过侦测,哥伦比亚号获取了一张海洋图。这张图将海洋部分分化成n*n个比较小的单位,其中用1标明的是陆地,用0标明是海洋。船只能从一个格子,移到相邻的四个格子。 为了尽快赶到出事地点,哥伦比亚号最少需要走多远的距离。 样例输入 3 001 101 100 ...
2018-08-05 08:41:43
1094
原创 车厢调度
题目描述 有一个火车站,铁路如图所示,每辆火车从A驶入,再从B方向驶出,同时它的车厢可以重新组合。假设从A方向驶来的火车有n节(n<=1000),分别按照顺序编号为1,2,3,…,n。假定在进入车站前,每节车厢之间都不是连着的,并且它们可以自行移动到B处的铁轨上。另外假定车站C可以停放任意多节车厢。但是一旦进入车站C,它就不能再回到A方向的铁轨上了,并且一旦当它进入B方向的铁轨,它就不能再...
2018-07-29 18:30:36
416
原创 骰子涂色(Cube painting,UVa 253)
骰子涂色; We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube’s faces are numbered as in Figure...
2018-07-22 17:00:10
291
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅