原题链接--

https://acs.jxnu.edu.cn/problem/CF6Dhttps://acs.jxnu.edu.cn/problem/CF6D

Lizards and Basements 2

2000ms  65536K

描述:

This is simplified version of the problem used on the original contest. The original problem seems to have too difiicult solution. The constraints for input data have been reduced.

Polycarp likes to play computer role-playing game «Lizards and Basements». At the moment he is playing it as a magician. At one of the last levels he has to fight the line of archers. The only spell with which he can damage them is a fire ball. If Polycarp hits the i-th archer with his fire ball (they are numbered from left to right), the archer loses a health points. At the same time the spell damages the archers adjacent to the i-th (if any) — they lose b (1 ≤ b < a ≤ 10) health points each.

As the extreme archers (i.e. archers numbered 1 and n) are very far, the fire ball cannot reach them. Polycarp can hit any other archer with his fire ball.

The amount of health points for each archer is known. An archer will be killed when this amount is less than 0. What is the minimum amount of spells Polycarp can use to kill all the enemies?

Polycarp can throw his fire ball into an archer if the latter is already killed.

译文:这是最初比赛中问题的简化版。原来的问题好像解决起来太困难了。输入数据的限制已经减少。保利卡喜欢玩电脑角色扮演游戏《蜥蜴和地下室》。此刻他扮演的是魔法师。在最后一关他必须与一排弓箭手战斗。唯一能伤害他们的咒语就是火球。如果保利卡用他的火球击中第i个弓箭手(从左到右编号) ,这个弓箭手将失去一点生命值。同时这个法术伤害第i个弓箭手 (如果有的话)附近的弓箭手ー他们失去b (1≤ b < a ≤10)生命值。

由于极限弓箭手(即1号和n号弓箭手)距离很远,火球无法到达他们。保利卡能用火球打到其他的弓箭手。

每个弓箭手的生命值已知。生命值少于0的弓箭手将死亡。保利卡使用的杀死所有敌人的咒语的数量是多少?

如果弓箭手已经被杀死,那么保利卡可以把他的火球扔进弓箭手。

输入:

The first line of the input contains three integers n, a, b (3 ≤ n ≤ 10; 1 ≤ b < a ≤ 10). The second line contains a sequence of n integers — h1, h2, ..., hn (1 ≤ hi ≤ 15), where hi is the amount of health points the i-th archer has.

译文:第一行输入包含三个整数 n, a, b (3 ≤ n ≤ 10; 1 ≤ b < a ≤ 10)。第二行包含n个数的序列— h1, h2, ..., hn (1 ≤ hi ≤ 15),hi是第i个弓箭手的生命值。

输出:

In the first line print t — the required minimum amount of fire balls.

In the second line print t numbers — indexes of the archers that Polycarp should hit to kill all the archers in t shots. All these numbers should be between 2 and n - 1. Separate numbers with spaces. If there are several solutions, output any of them. Print numbers in any order.

译文:第一行输出t —所需的最少火球数。

第二行输出t个数—t发火球射中弓箭手的下标。所有数字在2到n-1内。由空格分隔。如果有多种解决方案,输出任意一种。按任意顺序输出数字。

样例输入:

3 2 1
2 2 2

样例输出:

3
2 2 2 

样例输入:

4 3 1
1 4 1 1

样例输出:

4
2 2 3 3 

CF6D--Lizards and Basements 2译文相关推荐

  1. CF6D Lizards and Basements 2题解

    CF6D Lizards and Basements 2 题意:有n个人,编号1到n,每个人有血量 h i h_i hi​对某个人攻击会产生a点伤害,会波及到相邻的人,对相邻的人产生b点伤害(1和n号 ...

  2. CF6D Lizards and Basements 2(暴力dfs || dp)

    题目链接: Lizards and Basements 2 - 洛谷 思路: 看到数据不大,直接枚举每个位置的攻击次数即可.注意左边的弓箭手必须打死,另外,到n-1位置时,还必须把n-1和n都打死. ...

  3. LG-CF6D Lizards and Basements 2

    CF6D Lizards and Basements 2 题目链接 题意翻译 题意 有一队人,你可以用火球点某个人,会对当前人造成a点伤害,对旁边的人造成b点伤害. 不能打1号和n号,求最少多少发点死 ...

  4. 02.14 Lizards and Basements 2

    Lizards and Basements 2 | JXNUOJ 描述: This is simplified version of the problem used on the original ...

  5. CodeForces 6D Lizards and Basements 2(DFS)

    题意:有一串数字,每一次你可以使一个数字减少a,使相邻两个数字减少b,只能操作2-n-1次 思路:直接暴力DFS一波... #include<bits/stdc++.h> using na ...

  6. Lizards and Basements 2

    思路 题意:杀死n个敌人,你的火球可以给某个位置的敌人造成a点伤害,并且给该位置的相邻位置造成b点溅射伤害,并且你不能直接发火球攻击第一个和最后一个敌人,求最少需要多少次火球 做法:dfs,不过这里有 ...

  7. CodeForces 6D Lizards and Basements 2 (dfs)

    题意:给出一串n个元素序列.a和b,只能选择编号2 ~ n-1的s数字减a,并将相邻两数字减b,要使得所有元素为负,问至少需要多少次选择,选择是怎样的. 题解:dfs 我们可以发现只有2 ~ n-1编 ...

  8. Codeforces Beta Round #6 (Div. 2)【未完结】

    2022.3.4 题单地址:https://codeforces.com/contest/6 目录 A. Triangle[枚举] B. President's Office[枚举] C. Alice ...

  9. 华为18级工程师呕心沥血撰写3000页Linux学习笔记教程

    "Linux ?它比 Windows更好吗?我能用它打魔兽吗?" "咳!别提了,它操作起来特别麻烦,你得不停地敲击键盘.没准它还会趁你不注意的时候在你的手指头上咬一口呢! ...

最新文章

  1. 假期三天,我肝了万字的Java垃圾回收,看完你还敢说不会?
  2. BigDecimal类(精度计算类)的加减乘除
  3. js动态改变下拉菜单内容示例 .
  4. 数据结构 (计算机存储、组织数据方式)
  5. 每日一题——Leetcode203 移除链表元素
  6. Java文件File操作一:文件的创建和删除
  7. Apache配置文件httpd.conf详解
  8. MyBatis的动态SQL详解nbsp;(转载)
  9. 递归算法经典实例python-Python实现经典递归算法
  10. 联想ThinkPad E420安装7450M的显卡驱动后进入不了系统,试了4个系统都不..
  11. 因计算机磁盘硬件的pe,PE缺少AHCI驱动无法识别硬盘更新U盘启动盘中的WINPE
  12. Unity 查找重复图片资源以及引用 工具
  13. deepin linux查看ip,deepin使用iproute配置网络命令
  14. 寒假第一周 总结与反思
  15. 怎样做产品能甩同行一个时代?李彦宏说AI思维助你降维攻击
  16. Debian 安装搜狗输入法 亲测有效 安装notepadqq出现gpg: no valid OpenPGP data found. 解决办法
  17. es nested字段的空值查询问题
  18. 我们都被GitHub出卖了!逃跑吧兄弟!
  19. java根据物流单号查询物流详细
  20. 超强总结,用心分享丨大数据超神之路(三):Linux必备知识

热门文章

  1. 【转】二维码名片的格式 - vcard
  2. 【网络】网络通信原理
  3. 搭建嵌入式开发的vim环境【3】vim键位映射和插件的使用
  4. java语言程序设计第二版课后答案吴倩_Java语言程序设计
  5. 计算机配置虚拟vlan接口,虚拟局域网VLAN的设置
  6. office是指什么
  7. WebService 实例应用
  8. CLIENT_PLUGIN_AUTH is required 问题解决
  9. MCU-51:单片机LCD1602详解
  10. Qwt源码解读之平移操作类