For solving the following problem: "There is No Free Lunch" Time Limit: 1 Second Memory Limit: 3 - 免费下载

其他资源 文件大小:2 K

📋 资源详细信息

文件格式
RAR
所属分类
上传用户
上传时间
文件大小
2 K
所需积分
2 积分
推荐指数
⭐⭐⭐⭐⭐ (5/5)

💡 温馨提示:本资源由用户 GreatMarxist 上传分享,仅供学习交流使用。如有侵权,请联系我们删除。

资源简介

For solving the following problem: "There is No Free Lunch" Time Limit: 1 Second Memory Limit: 32768 KB One day, CYJJ found an interesting piece of commercial from newspaper: the Cyber-restaurant was offering a kind of "Lunch Special" which was said that one could "buy one get two for free". That is, if you buy one of the dishes on their menu, denoted by di with price pi , you may get the two neighboring dishes di-1 and di+1 for free! If you pick up d1, then you may get d2 and the last one dn for free, and if you choose the last one dn, you may get dn-1 and d1 for free. However, after investigation CYJJ realized that there was no free lunch at all. The price pi of the i-th dish was actually calculated by adding up twice the cost ci of the dish and half of the costs of the two "free" dishes. Now given all the prices on the menu, you are asked to help CYJJ find the cost of each of the dishes.

源码文件列表

📂 共 1 个源码文件 点击文件名可在线查看源代码

1 📄
na_3_02.c
大小: 1.27 KB
查看源码
💡
温馨提示:点击文件名或"查看源码"按钮可在线浏览源代码,支持语法高亮显示。

立即下载此资源

提示:下载后请用压缩软件解压,推荐使用 WinRAR 或 7-Zip

资源说明

📥 下载说明

  • 下载需消耗 2积分
  • 24小时内重复下载不扣分
  • 支持断点续传
  • 资源永久有效

📦 使用说明

  • 下载后用解压软件解压
  • 推荐 WinRAR 或 7-Zip
  • 如有密码请查看说明
  • 解压后即可使用

🎁 积分获取

  • 上传资源获得积分
  • 每日签到免费领取
  • 邀请好友注册奖励
  • 查看详情 →

相关标签

点击标签查看更多相关资源:

相关资源推荐