原题链接--

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. 三极管在ad中的原理图库_555时基电路内部结构及其工作原理
  2. C++随笔(2007-07-09)
  3. 拦截httpservlet返回码_设计 API 接口,实现统一格式返回
  4. 支配vue框架模版语法之v-cloak
  5. pythonurllib微博登录怎么删_Python使用cookielib和urllib2模拟登陆新浪微博并抓取数据...
  6. get/post 接口调用
  7. 结对开发——环形一维数组求最大子数组和
  8. 【转载】进程间的通信之剪贴板方法实现源码
  9. Hive _练习,更新中
  10. 谷歌 AI 专家爆料:90% 的人都不知道,编程能力差,其实都是输在了这点上!...
  11. datatable的查询介绍
  12. JSP七动作---<jsp:setProperty>
  13. 《诗经·王风·黍离》
  14. 如何生成EAN13流水号条形码
  15. 微信小程序 实现换肤功能
  16. oracle中text是什么意思,ORACLE TEXT是什么
  17. 关于POS终端安全 PCI做了哪些要求?
  18. 全国计算机二级考试mc,新版全国计算机等级考试二级MSoffice选择题题库.docx
  19. 使用vivado生成.MCS文件
  20. linux 安装 jdk8u222

热门文章

  1. 全球及中国光电晶体管输出光耦行业发展模式及十四五前景趋势预测报告2021-2027年版
  2. C#手写UserPref存档
  3. 手把手教程 | 使用AlphaFold进行蛋白质结构预测,探索生命信息密码
  4. java qname 调用soap_java 调用webservice的各种方法总结
  5. X86与海光(中科曙光+AMD)/兆芯(上海国资委+威盛)
  6. Matlab读取 mp4 视频 Error Creating Source Reader Reason: 不支持给定的 URL 的字节流类型
  7. 复现贪吃蛇程序——构造小蛇
  8. 设计网站中的精品,你可能需要它兼职赚钱--第一期
  9. HTML5 浏览器支持(h5的浏览器兼容性)
  10. php 写聊天室源码,php实现简易聊天室应用代码