📄 problem 1760.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=1760 -->
<HTML><HEAD><TITLE>Problem 1760</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 1760.files/logo.gif" align=center></IMG></CENTER>
<HR>
<CENTER><FONT color=blue size=+2>Doubles</FONT></CENTER>
<HR>
<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds <FONT
color=green>Memory limit: </FONT>32768K </FONT><BR><FONT
color=green>Total Submit:</FONT> 3102 <FONT color=green>Accepted
Submit:</FONT> 1908 </CENTER>
<HR>
As part of an arithmetic competency program, your students will be given
randomly generated lists of from 2 to 15 unique positive integers and asked to
determine how many items in each list are twice some other item in the same
list. You will need a program to help you with the grading. This program should
be able to scan the lists and output the correct answer for each one. For
example, given the list
<P>1 4 3 2 9 7 18 22<BR><BR>your program should answer 3, as 2 is twice 1, 4 is
twice 2, and 18 is twice 9. </P>
<P><BR><B>Input</B></P>
<P>The input file will consist of one or more lists of numbers. There will be
one list of numbers per line. Each list will contain from 2 to 15 unique
positive integers. No integer will be larger than 99. Each line will be
terminated with the integer 0, which is not considered part of the list. A line
with the single number -1 will mark the end of the file. The example input below
shows 3 separate lists. Some lists may not contain any doubles.</P>
<P><BR><B>Output</B></P>
<P>The output will consist of one line per input list, containing a count of the
items that are double some other item.</P>
<P><BR><B>Sample Input</B></P>
<P>1 4 3 2 9 7 18 22 0<BR>2 4 8 10 0<BR>7 5 11 13 1 3 0<BR>-1 </P>
<P><B><BR>Sample Output</B></P>
<P>3<BR>2<BR>0<BR></P>
<HR>
<FONT color=green size=+1>Problem Source: </FONT><I>Mid-Central USA 2003</I>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=1760">Submit</A>
<A href="http://acm.zju.edu.cn/list_problem.php?vol=8">Back</A>
<A
href="http://acm.zju.edu.cn/problem_status.php?pid=1760">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 + -