-
poly
标题: 多边形游戏
时 限: 1000 ms
内存限制: 10000 K
总时限: 3000 ms
描述: 多边形游戏是一个单人玩的游戏,开始时有一个由n个顶点构成的多边形。每个顶点被赋予一个整数值,每条边被赋予一个运算符“+”或“*”。所有边依次用整数从1到n编号。
游戏第1步,将一条边删除。
随后n-1步按以下方式操作:
(1)选择一条边E以及由E连接着的2个顶点V1和V2;
(2)用一个新的顶点取代边E以及由E连接着的2个顶点V1和V2。将由顶点V1和V2的整数值通过边E上的运算得到的结果赋予新顶点。
最后,所有边都被删除,游戏结束。游戏的得分就是所剩顶点上的整数值。
输入: 输入共两行,第一行一个整数n表示顶点个数,第二行共2*n个数,分别为数字和字符。
例如:对于上图中的问题,我们可以这样按输入样例中的例子输入,数学中的“+”号代表加法,小写字母“x”代表乘法。
输出: 一个整数,计算最高得分。
输入样例: 5
10 + -1 x -2 x 3 + -8 x
输出样例: 486
(标题: 多边形游戏
时 限: 1000 ms
内存限制: 10000 K
总时限: 3000 ms
描述: 多边形游戏是一个单人玩的游戏,开始时有一个由n个顶点构成的多边形。每个顶点被赋予一个整数值,每条边被赋予一个运算符“+”或“*”。所有边依次用整数从1到n编号。
游戏第1步,将一条边删除。
随后n-1步按以下方式操作:
(1)选择一条边E以及由E连接着的2个顶点V1和V2;
(2)用一个新的顶点取代边E以及由E连接着的2个顶点V1和V2。将由顶点V1和V2的整数值通过边E上的运算得到的结果赋予新顶点。
最后,所有边都被删除,游戏结束。游戏的得分就是所剩顶点上的整数值。
输入: 输入共两行,第一行一个整数n表示顶点个数,第二行共2*n个数,分别为数字和字符。
例如:对于上图中的问题,我们可以这样按输入样例中的例子输入,数学中的“+”号代表加法,小写字母“x”代表乘法。
输出: 一个整数,计算最高得分。
输入样例: 5
10+-1 x-2 x 3+-8 x
输出样例: 486
)
- 2012-12-17 10:35:16下载
- 积分:1
-
C-and-CPP-Tips
C和C++程序员面试秘笈,解析C/C++面试题的书,可以帮助求职者更好地准备面试(C and C++ programmer interview tips, analytical C/C++ face questions of the book, can help candidates better prepare for interview)
- 2015-08-24 11:32:17下载
- 积分:1
-
OpenSees2.2.1
OpenSees2.2.1源代码,有限元开源软件(OpenSees2.2.1 source code)
- 2018-05-06 13:35:16下载
- 积分:1
-
675646545
VB反应能力测试小游戏,打地鼠源代码.有需要的下.(VB reaction capability test game, play hamster source code are in need.)
- 2013-08-23 17:56:27下载
- 积分:1
-
company1-2
公司有n个员工,编号1 ~ n。员工数量众多,需要你为他们编写一个管理系统。
员工上班时都要登录管理系统登记一个code,离开要从管理系统上注销,员工也可以随时更新自己的code。到了下班时间,所有员工都会自动注销。公司管理人员随时都可能想要知道有多少员工上班,以及任一员工登记的code。(The company has n employees, number 1 ~ n. There are so many employees that you need to write a management system for them.
When employees go to work, login to the management system to register a code, leave to log off from the management system, employees can also update their code at any time. By the end of the day, all employees will automatically log out. Company managers may at any time want to know how many employees go to work, and the number of code registered by any employee.)
- 2017-10-14 16:30:03下载
- 积分:1
-
自己写的一个VB小玩一
wrpj2eor2]3rw;fjeoiwyfr98ur23po(ajksfleiufypefjlkfanl;hfkpwoeuir)
- 2019-06-08 23:07:37下载
- 积分:1
-
GameBall
弹球游戏,利用滑块移动碰撞弹球,使探球弹起碰撞商贩的滑块来赢得分数。(a game of ball ,ball and slider game,you can move the slider to collide the ball ,ball can move also to collide sliders where above the first slider.)
- 2012-03-19 16:32:26下载
- 积分:1
-
liusdeng
流水灯的基本控制流水灯的一次点亮,更好理解流水灯,是LPC2103芯片(Lights control of water flowing light a light, a better understanding of light water, the LPC2103 chip)
- 2012-07-05 23:39:17下载
- 积分:1
-
TFontHealthprh
Visual C下提取点阵字模源代码,可可直接生成C语言的code,可选字体,大小.
(The dot matrix source code Visual C extract, cocoa directly generate C language code, selectable font, size.)
- 2012-08-07 01:19:02下载
- 积分:1
-
Xcel
本程序可对EXCEL文件进行读写,同时建立了一个专门访问EXCEL文件的类CExcel,可供大家参考。(This procedure can be carried out on the EXCEL file to read and write, while the establishment of a specialized type of access EXCEL file CExcel, for your reference.)
- 2009-05-31 11:37:50下载
- 积分:1