⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 problem 1057.htm

📁 zju_acm部分代码!都是自己做 有些事基本题目!题目还可以
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=1057 -->
<HTML><HEAD><TITLE>Problem 1057</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<CENTER><IMG src="Problem 1057.files/logo.gif" align=center></IMG></CENTER>
<HR>

<CENTER><FONT color=blue size=+2>Undercut</FONT></CENTER>
<HR>

<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds&nbsp;&nbsp; <FONT 
color=green>Memory limit: </FONT>32768K&nbsp;&nbsp; </FONT><BR><FONT 
color=green>Total Submit:</FONT> 9183&nbsp;&nbsp; <FONT color=green>Accepted 
Submit:</FONT> 2142&nbsp;&nbsp; </CENTER>
<HR>
Undercut is a card game where two players each have five cards numbered one 
through five. At each round, each player selects a card, then simultaneously 
reveals it. If the cards are of equal value, there is no score. Otherwise, there 
are two cases: the two cards are exactly one point apart (this is called an 
undercut), or the cards are more than one point apart. In the latter case, the 
person revealing the larger of the cards gets the number of points on the larger 
card. In the case of an undercut the player with the lower card gets the sum of 
the two cards. The exception to this is when the cards are 1 and 2, in which 
case the player with the lower card gets 6 points (instead of only 3 points). 
After each round, the cards are returned to the hands and they play another 
round. 
<P>For example, if there are 5 rounds and player A plays (in this order) 5, 3, 
1, 3, 5 and player B plays 3, 3, 3, 3, 4, then the scoring for each round would 
be: A gets 5 points, no points, B gets 3 points, no points, B gets 9 points. The 
totals would be A: 5, B: 12.</P>
<P>In this problem you will be given card plays for both players and must 
determine the final scores.<BR><BR></P>
<P><B>Input</B></P>
<P>There will be multiple input instances. Each instance will be one game. The 
first line of input for a game will be an integer n &lt;= 20. (A value of n = 0 
terminates input.) The next two lines will each contain n integers between 1 and 
5 inclusive indicating the cards played on each of n rounds. The first line are 
player A's card plays and the second line are player B's card plays.<BR><BR></P>
<P><B>Output</B></P>
<P>Each input instance should generate one line of output of the form:</P>
<P>A has a points. B has b points.</P>
<P>where the value of a and b are for you to determine. A blank line should 
separate output lines.<BR><BR></P>
<P><B>Sample Input</B></P>
<P>5<BR>5 3 1 3 5<BR>3 3 3 3 4<BR>4<BR>2 3 1 1<BR>1 5 5 5<BR>0<BR><BR></P>
<P><B>Sample Output</B></P>
<P>A has 5 points. B has 12 points.</P>
<P>A has 0 points. B has 21 points.</P>
<HR>
<FONT color=green size=+1>Problem Source: </FONT><I>East Central North America 
2001, Practice</I>
<HR>
 
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=1057">Submit</A> 
&nbsp;&nbsp;<A href="http://acm.zju.edu.cn/list_problem.php?vol=1">Back</A> 
&nbsp;&nbsp;<A 
href="http://acm.zju.edu.cn/problem_status.php?pid=1057">Status</A> </CENTER>
<HR>

<CENTER>
<TABLE width="100%" border=0>
  <TBODY>
  <TR>
    <TD align=right width="65%"><A href="http://acm.zju.edu.cn/"><FONT 
      color=red>Zhejiang University Online Judge</FONT></A> <A 
      href="http://acm.zju.edu.cn/"><FONT color=red>V1.0</FONT></A></TD>
    <TD align=right width="35%"><A href="http://www.zzhang.cn/"><FONT 
      color=#ffffff 
size=-3>Book</FONT></A></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -