| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 921 人关注过本帖
标题:翻译一道acm的题,"intetpreter",拜谢OTL!
只看楼主 加入收藏
shinjisouji
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-10-5
收藏
 问题点数:0 回复次数:5 
翻译一道acm的题,"intetpreter",拜谢OTL!

做不出来,怀疑理解有误~~大家帮忙看一下吧~~~ ^^

Problem G: Interpreter

A certain computer has 10 registers and 1000 words of RAM. Each register or RAM location holds a 3-digit integer between 0 and 999. Instructions are encoded as 3-digit integers and stored in RAM. The encodings are as follows:
100 means halt
2dn means set register d to n (between 0 and 9)
3dn means add n to register d
4dn means multiply register d by n
5ds means set register d to the value of register s
6ds means add the value of register s to register d
7ds means multiply register d by the value of register s
8da means set register d to the value in RAM whose address is in register a
9sa means set the value in RAM whose address is in register a to the value of register s
0ds means goto the location in register d unless register s contains 0
All registers initially contain 000. The initial content of the RAM is read from standard input. The first instruction to be executed is at RAM address 0. All results are reduced modulo 1000.

Input
The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs.


The input to your program consists of up to 1000 3-digit unsigned integers, representing the contents of consecutive RAM locations starting at 0. Unspecified RAM locations are initialized to 000.

Output
For each test case, the output must follow the description below. The outputs of two consecutive cases will be separated by a blank line.


The output from your program is a single integer: the number of instructions executed up to and including the halt instruction. You may assume that the program does halt.

Sample Input
1

299
492
495
399
492
495
399
283
279
689
078
100
000
000
000

Sample Output
16

搜索更多相关主题的帖子: acm OTL intetpreter 拜谢 翻译 
2007-10-14 23:10
shinjisouji
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-10-5
收藏
得分:0 
有没有人知道哪里有acm习题的翻译版的?谢谢大家~~~~
2007-10-14 23:21
鸿工作室
Rank: 1
等 级:新手上路
帖 子:89
专家分:0
注 册:2007-10-14
收藏
得分:0 

好长的英文,看完都没命做了...


2007-10-14 23:22
shinjisouji
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-10-5
收藏
得分:0 

拜托啊~~~仅仅是翻译一下~~~本人英语太烂,理解出问题了~~~

2007-10-14 23:26
shinjisouji
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-10-5
收藏
得分:0 
无良地顶一下,真的很想知道怎么回事~~~~大家帮帮忙~~~
http://acm.uva.es/p/v100/10033.html
2007-10-15 09:35
shinjisouji
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-10-5
收藏
得分:0 
大家帮我看一下sample input和sample output吧,我算的不是17步就是18步TT~~~~~
2007-10-15 10:23
快速回复:翻译一道acm的题,"intetpreter",拜谢OTL!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039351 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved