题目
英语翻译
Description
The multiplication puzzle is played with a row of cards,each containing a single positive integer.During the move player takes one card out of the row and scores the number of points equal to the product of the number on the card taken and the numbers on the cards on the left and on the right of it.It is not allowed to take out the first and the last card in the row.After the final move,only two cards are left in the row.
The goal is to take cards in such order as to minimize the total number of scored points.
For example,if cards in the row contain numbers 10 1 50 20 5,player might take a card with 1,then 20 and 50,scoring
10*1*50 + 50*20*5 + 10*50*5 = 500+5000+2500 = 8000
If he would take the cards in the opposite order,i.e.50,then 20,then 1,the score would be
1*50*20 + 1*20*5 + 10*1*5 = 1000+100+50 = 1150.
Input
The first line of the input contains the number of cards N (3
Description
The multiplication puzzle is played with a row of cards,each containing a single positive integer.During the move player takes one card out of the row and scores the number of points equal to the product of the number on the card taken and the numbers on the cards on the left and on the right of it.It is not allowed to take out the first and the last card in the row.After the final move,only two cards are left in the row.
The goal is to take cards in such order as to minimize the total number of scored points.
For example,if cards in the row contain numbers 10 1 50 20 5,player might take a card with 1,then 20 and 50,scoring
10*1*50 + 50*20*5 + 10*50*5 = 500+5000+2500 = 8000
If he would take the cards in the opposite order,i.e.50,then 20,then 1,the score would be
1*50*20 + 1*20*5 + 10*1*5 = 1000+100+50 = 1150.
Input
The first line of the input contains the number of cards N (3
提问时间:2021-04-01
答案
描述:
乘法游戏是用一排卡片玩的,每张卡片上有一个正整数.在游戏中玩家取出一张卡片记下得分,得分等于他取出的卡片及其左边、右边相邻卡片上的三个整数的乘积.第一张和最后一张卡片不允许取出.取出最后一张卡片后,原来的一排卡片就只剩下了两张.
游戏的目标就是获得的分数最少.
例如有一排卡片,分数分别是10 1 50 20 5,玩家可能先取1,然后是20,最后是50,得分就是:10*1*50 + 50*20*5 + 10*50*5 = 500+5000+2500 = 8000
如果他按相反的顺序来取,即50、20、1,得分就是:
1*50*20 + 1*20*5 + 10*1*5 = 1000+100+50 = 1150.
---------------------
输入
输入的第一行包括卡片的数目N(3 <= N <= 100).
第二行包括N个范围在1 到100的整数,用空格隔开.
输出
输出必须包含单个整数,即最小的得分
输入示例
6
10 1 50 50 20 5
输出示例
3650
================
好像是在说一个程序吧?
乘法游戏是用一排卡片玩的,每张卡片上有一个正整数.在游戏中玩家取出一张卡片记下得分,得分等于他取出的卡片及其左边、右边相邻卡片上的三个整数的乘积.第一张和最后一张卡片不允许取出.取出最后一张卡片后,原来的一排卡片就只剩下了两张.
游戏的目标就是获得的分数最少.
例如有一排卡片,分数分别是10 1 50 20 5,玩家可能先取1,然后是20,最后是50,得分就是:10*1*50 + 50*20*5 + 10*50*5 = 500+5000+2500 = 8000
如果他按相反的顺序来取,即50、20、1,得分就是:
1*50*20 + 1*20*5 + 10*1*5 = 1000+100+50 = 1150.
---------------------
输入
输入的第一行包括卡片的数目N(3 <= N <= 100).
第二行包括N个范围在1 到100的整数,用空格隔开.
输出
输出必须包含单个整数,即最小的得分
输入示例
6
10 1 50 50 20 5
输出示例
3650
================
好像是在说一个程序吧?
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1My summer holiday (要用上be going to)英语作文 5句以上
- 2乐乐今年十岁,下面的时间中,()最接近她的年龄. A.100个月 B.500周 C.36000天 D.2万小时
- 3初二上文言文阅读
- 4已知a+x2=2003,b+x2=2004,c+x2=2005,且abc=6012,求a/bc+b/ca+c/ab−1/a−1/b−1/c的值.
- 5提取碘的过程中,可供选择的有机试剂是?
- 6如何形容中国的名胜古迹
- 7如果等差数列an的a5=5 a10=-5 那么此数列的第一个负数是第几项
- 8一桶水,用去60%,还剩15千克.这桶水重多少千克?
- 9少先队员参加登高比赛,分成若干组,如果分成4人、10人、30人一组都余2人,至少有多少个少先队员(要步骤
- 102.the dining-room is too crowded to have___for us to come in.Shall we go out for dinner?
热门考点
- 1学校食堂去年计划烧煤120吨,实际比原计划节约了12.5%,实际烧煤多少吨?
- 2计算器按法:5.5*6.2-4.2*3.5 这个算式如何用计算器一步算出结果
- 3(结果用度、分、秒表示)(1)56.6°+72°42′
- 4关于在运动会上的感动700字作文
- 5将4:5的前项增加8,要使比值不变,后项应增加多少?
- 6在操纵子上,DNA可与蛋白质或酶结合的区域包括A启动序列B结构基因C CAP结合位点 D调节基因E操纵序列
- 7实际造林比计划多百分之几,是把_看作单位“1”,就是求_比_多的面积是_的百分之几.
- 8简答:糖尿病是“富贵病”,请你设计实验检验病人尿液中的葡萄糖,并与正常人作对比,设计要求: (1)写出实验所用化学药品 (2)写出实验现象并作出结论.
- 9You must tell him to go out at once.句型转换,毎空一词You must tell him to go out ( )( )
- 10浮云游子意,落日故人群表达的作用?最后一句的马鸣的目的是什么