📄 1969 -- count on canton.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0061)http://acm.pku.edu.cn/JudgeOnline/showproblem?problem_id=1969 -->
<HTML><HEAD><TITLE>1969 -- Count on Canton</TITLE>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>A {
TEXT-DECORATION: none
}
A:hover {
COLOR: red; TEXT-DECORATION: underline
}
</STYLE>
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY vLink=blue aLink=blue link=blue leftMargin=5><A name=top></A>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#ffffff width=980
border=1><TBODY>
<TR>
<TD align=middle colSpan=5><IMG height=97
src="1969 -- Count on Canton.files/logo.jpg" width=980 border=0></TD></TR>
<TR vAlign=top align=middle bgColor=#6589d1>
<TH width=196>Online Judge</TH>
<TH width=196>Problem Set</TH>
<TH width=196>Authors</TH>
<TH width=197>Online Contests</TH>
<TH width=197>User</TH></TR>
<TR vAlign=top align=middle bgColor=#f1f1fd>
<TD><A href="http://acm.pku.edu.cn/JudgeOnline/bbs">Web Board</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/">Home Page</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/faq.htm"
target=_blank>F.A.Qs</A><BR>Announcement</TD>
<TD>
<FORM action=gotoproblem method=get><A
href="http://acm.pku.edu.cn/JudgeOnline/problemlist">Problems</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/submitpage">Submit
Problem</A><BR><A href="http://acm.pku.edu.cn/JudgeOnline/status">Status
(Online)</A><BR><FONT color=blue>Prob.ID:</FONT><INPUT size=6 name=pid><INPUT type=submit value=Go name=pb1></FORM></TD>
<TD>
<FORM action=searchuser method=get><A
href="http://acm.pku.edu.cn/JudgeOnline/registerpage">Register</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/modifyuserpage">Update your
info</A><BR><A href="http://acm.pku.edu.cn/JudgeOnline/userlist">Authors
ranklist</A><BR><INPUT size=10 name=user_id><INPUT type=submit value=Search name=B1></FORM></TD>
<TD><FONT color=#1a5cc8>Current Contest</FONT><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/pastcontests">Past
Contests</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/contests">Scheduled
Contests</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/awardcontest_announce.htm"
target=_blank><FONT color=red>Award Contest</FONT></A></TD>
<TD align=left>Welcome<BR><A
href="http://acm.pku.edu.cn/JudgeOnline/userstatus?user_id=fjnu_jxd_009"
target=_parent><B>fjnu_jxd_009</B></A> <A
href="http://acm.pku.edu.cn/JudgeOnline/login?action=logout&url=/JudgeOnline/showproblem?problem_id=1969">Log
Out</A><BR><A href="http://acm.pku.edu.cn/JudgeOnline/mail"
target=_parent><FONT
color=blue>Mail:1(<B>0</B>)</FONT></A></TD></TR></TBODY></TABLE>
<TABLE width="100%" background="1969 -- Count on Canton.files/table_back.jpg"
border=0>
<TBODY>
<TR>
<TD>
<P align=center><FONT color=blue size=5>Count on Canton</FONT> <BR>Time
Limit:1000MS Memory Limit:30000K<BR>Total Submit:1694 Accepted:842
</P>
<P><FONT color=blue size=5>Description</FONT><BR><FONT
face="Times New Roman" size=3>One of the famous proofs of modern
mathematics is Georg Cantor's demonstration that the set of rational
numbers is enumerable. The proof works by using an explicit enumeration of
rational numbers as shown in the diagram below. <BR><PRE>1/1 1/2 1/3 1/4 1/5 ...
<BR>2/1 2/2 2/3 2/4
<BR>3/1 3/2 3/3
<BR>4/1 4/2
<BR>5/1
<BR></PRE><BR>In the above diagram, the first term is 1/1, the second term
is 1/2, the third term is 2/1, the fourth term is 3/1, the fifth term is
2/2, and so on.</FONT>
<P></P>
<P><FONT color=blue size=5>Input</FONT><BR><FONT face="Times New Roman"
size=3>The input list contains a single number per line and will be
terminated by endof-file.</FONT></P>
<P><FONT color=blue size=5>Output</FONT><BR><FONT face="Times New Roman"
size=3>You are to write a program that will read a list of numbers in the
range from 1 to 10^7 and will print for each number the corresponding term
in Cantor's enumeration as given below.</FONT></P>
<P><FONT color=blue size=5>Sample Input</FONT><BR><FONT
face="Times New Roman" size=3><PRE>3
14
7</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Sample Output</FONT><BR><FONT
face="Times New Roman" size=3><PRE>TERM 3 IS 2/1
TERM 14 IS 2/4
TERM 7 IS 1/4</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Source</FONT><BR><FONT face="Times New Roman"
size=3>Southeastern Europe 2004</FONT></P></TD></TR></TBODY></TABLE><FONT
color=#333399 size=3>
<P align=center>[<A
href="http://acm.pku.edu.cn/JudgeOnline/submitpage?problem_id=1969">Submit</A>]
[<A href="javascript:history.go(-1)">Go Back</A>] [<A
href="http://acm.pku.edu.cn/JudgeOnline/problemstatus?problem_id=1969">Status</A>]
[<A href="http://acm.pku.edu.cn/JudgeOnline/bbs?problem_id=1969">Discuss</A>]
</FONT></P>
<P><IMG height=29 src="1969 -- Count on Canton.files/home.jpg" width=40
border=0><FONT size=3><A href="http://acm.pku.edu.cn/JudgeOnline/">Home Page</A>
</FONT> <IMG height=29 src="1969 -- Count on Canton.files/goback.jpg"
width=40 border=0><FONT size=3><A href="javascript:history.go(-1)">Go
Back</A> <IMG height=29 src="1969 -- Count on Canton.files/top.jpg"
width=40 border=0><A
href="http://acm.pku.edu.cn/JudgeOnline/showproblem?problem_id=1969#top">To
top</A></FONT><BR>
<HR>
<P align=center><FONT size=3>All Copyright Reserved 2003-2005 Ying Fuchen,Xu
Pengcheng<BR>Any problem, Please <A href="mailto:hawking@pku.edu.cn">Contact
Administrator</A></FONT></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -