首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 用java解决经典问题(渡河问题)

用java解决经典问题(渡河问题)

  • 资源大小:3.43 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: java algorithm

资 源 简 介

Rules The faster time is the better solution Maximum items can crossing river per round is 2 Require at least one to drive a boat Result [[ GO ] | [BACK]] [, ] -> Total time is * GO, BACK - Direction of boat * X0, X1 - Weight of person * W - Weight per round * T - Total weight Sample java -jar RiverCrossing.jar 1 5 2 10[ GO ] 1 2 -> 2[BACK] 1 -> 1[ GO ] 10 5 -> 10[BACK] 2 -> 2[ GO ] 1 2 -> 2Total time is 17 Enjoy :P
VIP VIP
0.193591s