UVa 10557:XYZZY

题目链接

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=105&page=show_problem&problem=1498

题目类型: 搜索

题目:

The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an attempt at computer-refereed fantasy gaming, and expanded into a puzzle-oriented game by Don Woods at Stanford in 1976. (Woods had been one of the authors of INTERCAL.) Now better known as Adventure or Colossal Cave Adventure, but the TOPS-10 operating system permitted only six-letter filenames in uppercase. See also vadding, Zork, and Infocom.

It has recently been discovered how to run open-source software on the Y-Crate gaming device. A number of enterprising designers have developed Advent-style games for deployment on the Y-Crate. Your job is to test a number of these designs to see which are winnable.

Each game consists of a set of up to 100 rooms. One of the rooms is the start and one of the rooms is thefinish. Each room has an energy value between -100 and +100. One-way doorways interconnect pairs of rooms.

The player begins in the start room with 100 energy points. She may pass through any doorway that connects the room she is in to another room, thus entering the other room. The energy value of this room is added to the player's energy. This process continues until she wins by entering the finish room or dies by running out of energy (or quits in frustration). During her adventure the player may enter the same room several times, receiving its energy each time.

The input consists of several test cases. Each test case begins with n, the number of rooms. The rooms are numbered from 1 (the start room) to n (the finish room). Input for the n rooms follows. The input for each room consists of one or more lines containing:

the energy value for room i

the number of doorways leaving room i

a list of the rooms that are reachable by the doorways leaving room i

The start and finish rooms will always have enery level 0. A line containing -1 follows the last test case.

In one line for each case, output "winnable" if it is possible for the player to win, otherwise output "hopeless".

题目翻译:

背景:典型的电脑冒险游戏,最早出现在1970年代中期的PDP-10电脑(数字设备公司DEC生产的)上,是由Will Crowther设计的。这是一种尝试由电脑裁判的奇幻游戏。1976年在斯坦福大学的Don Woods把它拓展成一个拼图游戏(Don Woods是INTERCAL的作者之一)。现在更出名的是冒险或巨大的洞穴探险游戏。但是PDP-10的操作系统只允许6个大写字母的文件名。更多信息请查询vadding, Zork,和Infocom. 最近人们发现如何在Y-Crate游戏设备上运行开源软件。很多企业的设计师都有部署开发好的Advent-Style风格游戏在Y-Crate上。你的工作就是测试这些设计是否可能获胜的。 每场比赛由一组100个房间组成。其中一个房间是起点,另一个房间是终点。 每个房间有一个能量值 ,从 -100到+ 100。其中有一些只能单向行走的门把这些房间连接起来。 玩家开始时会自动获得100点能量值。 她可以通过单向房间门进入另一个门,并且可以任意重复次数进入一个房间,而且每次进入那个房间都可以获得那个能量值(正的能量值是增加她的能量,负值减少她的能量)。如果在能量用完(变为0或者负数)之前能够走到终点房间,那么就可以赢。否则,就是输。

样例输入:

5
0 1 2
-60 1 3
-60 1 4
20 1 5
0 0
5
0 1 2
20 1 3
-60 1 4
-60 1 5
0 0
5
0 1 2
21 1 3
-60 1 4
-60 1 5
0 0
5
0 1 2
20 2 1 3
-60 1 4
-60 1 5
0 0
-1
样例输出:
hopeless
hopeless
winnable
winnable

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索vad
, 游戏googlebeta testing
, 一个
, of
, Room
The
uva oj、uva和uvb的区别、uvb、uva大学、弗吉尼亚大学,以便于您获取更多的相关知识。

时间: 2024-08-01 12:17:41

UVa 10557:XYZZY的相关文章

uva 10557 - XYZZY hdu 1317

点击打开链接uva10557 点击打开链接hdu 1317 思路:SPFA+dfs 分析: 1 题目的图是一个有向图,并且可能存在环.第一个点的能量值为100,边的权值利用能量大小,例如2点为-60,如果1->2那么value[1][2] = -60 2 题目明确指出如果是要win的话,那么必须是经过的每条边都要大于0.那么我们只要把那些经过松弛操作后的点大于0的入队即可,小于等于0的点肯定不会出现在最终的路径上. 3 如果存在正环的话,那么就有能量值无限大,那么这个时候只要判断这个点能否到达n

UVa 1422:Processor 任务处理问题

题目大意:有n个任务送到处理器处理,每个任务信息包括r,d,w,r代表开始时间,w代表必须要结束的时间,w指需要多少时间处理. 其中处理器的处理速度可以变速,问处理器最小需要多大速度才能完成工作? 输入: 3 5 1 4 2 3 6 3 4 5 2 4 7 2 5 8 1 6 1 7 25 4 8 10 7 10 5 8 11 5 10 13 10 11 13 5 8 15 18 10 20 24 16 8 15 33 11 14 14 1 6 16 16 19 12 3 5 12 22 25

UVa 10905:Children's Game

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1846 类型: 排序 There are lots of number games for children. These games are pretty easy to play but not so easy to make. We will

UVa 10763:Foreign Exchange

题目链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1704 原题: Your non-profit organization (iCORE - international Confederation of Revolver Enthusiasts) coordinates a very succes

UVa 10341: Solve It

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1282 原题: Solve the equation:        p*e-x + q*sin(x) + r*cos(x) + s*tan(x) + t*x2 + u = 0        where 0 <= x <= 1. Input

UVa 10057:A mid-summer night&#039;s dream.

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=998 原题: This is year 2200AD. Science has progressed a lot in two hundred years. Two hundred years is mentioned here because thi

UVa 10487:Closest Sums

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1428 原题: Given is a set of integers and then a sequence of queries. A query gives you a number and asks to find a sum of two di

UVa 10340:All in All

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1281 原题: You have devised a new encryption technique which encodes a message by inserting between its characters randomly gener

UVa 10700:Camel trading

链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1641 原题: Background Aroud 800 A.D., El Mamum, Calif of Baghdad was presented the formula 1+2*3*4+5, which had its origin in the