站外题求助
  • 板块灌水区
  • 楼主IntoTheDusk
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/4/2 21:56
  • 上次更新2024/4/3 13:32:22
查看原帖
站外题求助
784829
IntoTheDusk楼主2024/4/2 21:56

https://acm.timus.ru/problem.aspx?space=1&num=1394

题意:n个军舰,m个海岸线,各个长度给出,求n个军舰怎么组成这些海岸线。

原题面:The military intelligence of one country found out that N (N < 100) battle ships of neighboring enemy country are situated in M rows (1 < M < 10). The intelligence knows the lengths l1, l2, …, lN of the battle ships which are whole numbers in the interval [1, 100], and wants to know in which rows the ships are situated. The only thing that is known about the M rows are their lengths — L1, L2, …, LM. Assume that the ships touch their neighbours in the rows and that every row contains at least one ship. Write program that will find one possible ordering of the ships in rows.

2024/4/2 21:56
加载中...