📄 1338 -- ugly numbers.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0049)http://acm.pku.edu.cn/JudgeOnline/problem?id=1338 -->
<HTML><HEAD><TITLE>1338 -- Ugly Numbers</TITLE>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="1338 -- Ugly Numbers.files/poj.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="1338 -- Ugly Numbers.files/poj.js"></SCRIPT>
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY vLink=blue aLink=blue link=blue leftMargin=5><A name=top></A>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#ffffff width="100%"
border=1>
<TBODY>
<TR>
<TD align=middle colSpan=5>
<TABLE class=h1 cellPadding=0>
<TBODY>
<TR>
<TD width="25%" alight="left"><IMG height=100
src="1338 -- Ugly Numbers.files/logo1.jpg" border=0></TD>
<TD bgColor=#eaeffd colSpan=3>
<TABLE class=h2>
<TBODY>
<TR>
<TD><IMG height=90 src="1338 -- Ugly Numbers.files/logo0.gif"
width=450 border=0></TD>
<TD width=95><IMG height=95
src="1338 -- Ugly Numbers.files/logo3.gif" width=95
border=0></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR vAlign=top align=middle bgColor=#6589d1>
<TH class=h>Online Judge</TH>
<TH class=h>Problem Set</TH>
<TH class=h>Authors</TH>
<TH class=h>Online Contests</TH>
<TH class=h>User</TH></TR>
<TR vAlign=top align=middle bgColor=#f1f1fd>
<TD class=h onmouseover="scbg(this, 1)" onmouseout="scbg(this, 0)"><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 class=h onmouseover="scbg(this, 1)" onmouseout="scbg(this, 0)">
<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/submit">Submit Problem</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/status">Online Status</A><BR><FONT
color=blue>Prob.ID:</FONT><INPUT size=6 name=pid><INPUT type=submit value=Go name=pb1></FORM></TD>
<TD class=h onmouseover="scbg(this, 1)" onmouseout="scbg(this, 0)">
<FORM action=searchuser method=get><A
href="http://acm.pku.edu.cn/JudgeOnline/register">Register</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/modifyuser">Update your
info</A><BR><A href="http://acm.pku.edu.cn/JudgeOnline/userlist">Authors
ranklist</A><BR><INPUT size=10 name=key><INPUT type=submit value=Search name=B1></FORM></TD>
<TD class=h onmouseover="scbg(this, 1)" onmouseout="scbg(this, 0)"><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"><FONT
color=red>Scheduled Contests</FONT></A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/awardcontest_announce.htm"
target=_blank><FONT color=red>Award Contest</FONT></A></TD>
<TD class=h onmouseover="scbg(this, 1)" onmouseout="scbg(this, 0)"
align=left>
<FORM action=login method=post>
<TABLE>
<TBODY>
<TR>
<TD>User ID:</TD>
<TD><INPUT size=10 name=user_id1></TD></TR>
<TR>
<TD>Password:</TD>
<TD><INPUT type=password size=10 name=password1></TD></TR></TBODY></TABLE><INPUT type=submit value=login name=B1> <A
href="http://acm.pku.edu.cn/JudgeOnline/register"
target=_parent>Register</A><INPUT type=hidden
value=/JudgeOnline/problem?id=1338 name=url></FORM></TD></TR></TBODY></TABLE>
<TABLE width="100%" background="1338 -- Ugly Numbers.files/table_back.jpg"
border=0>
<TBODY>
<TR>
<TD>
<P align=center><FONT color=blue size=5>Ugly Numbers</FONT> <BR>Time
Limit:1000MS Memory Limit:10000K<BR>Total Submit:3822 Accepted:1647
</P>
<P><FONT color=blue size=5>Description</FONT><BR><FONT
face="Times New Roman" size=3>Ugly numbers are numbers whose only prime
factors are 2, 3 or 5. The sequence <BR>1, 2, 3, 4, 5, 6, 8, 9, 10, 12,
... <BR>shows the first 10 ugly numbers. By convention, 1 is included.
<BR>Given the integer n,write a program to find and print the n'th ugly
number. <BR></FONT></P>
<P><FONT color=blue size=5>Input</FONT><BR><FONT face="Times New Roman"
size=3>Each line of the input contains a postisive integer n (n <=
1500).Input is terminated by a line with n=0.</FONT></P>
<P><FONT color=blue size=5>Output</FONT><BR><FONT face="Times New Roman"
size=3>For each line, output the n’th ugly number .:Don’t deal with the
line with n=0.</FONT></P>
<P><FONT color=blue size=5>Sample Input</FONT><BR><FONT
face="Times New Roman" size=3><PRE>1
2
9
0
</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Sample Output</FONT><BR><FONT
face="Times New Roman" size=3><PRE>1
2
10
</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Source</FONT><BR><FONT face="Times New Roman"
size=3><A
href="http://acm.pku.edu.cn/JudgeOnline/searchproblem?field=source&key=New Zealand 1990 Division I">New
Zealand 1990 Division I</A>,UVA 136</FONT></P></TD></TR></TBODY></TABLE><FONT
color=#333399 size=3>
<P align=center>[<A
href="http://acm.pku.edu.cn/JudgeOnline/submit?problem_id=1338">Submit</A>]
[<A href="javascript:history.go(-1)">Go Back</A>] [<A
href="http://acm.pku.edu.cn/JudgeOnline/problemstatus?problem_id=1338">Status</A>]
[<A href="http://acm.pku.edu.cn/JudgeOnline/bbs?problem_id=1338">Discuss</A>]
</FONT></P>
<P><IMG height=30 src="1338 -- Ugly Numbers.files/home.gif" width=40
border=0><FONT size=3><A href="http://acm.pku.edu.cn/JudgeOnline/">Home Page</A>
</FONT> <IMG height=30 src="1338 -- Ugly Numbers.files/goback.gif"
width=40 border=0><FONT size=3><A href="javascript:history.go(-1)">Go
Back</A> <IMG height=30 src="1338 -- Ugly Numbers.files/top.gif"
width=40 border=0><A
href="http://acm.pku.edu.cn/JudgeOnline/problem?id=1338#top">To
top</A></FONT><BR>
<HR>
<P style="FONT-FAMILY: Arial," align=center sans-serif Helvetica,>All Rights
Reserved 2003-2006 Ying Fuchen,Xu Pengcheng,Xie Di<BR>Any problem, Please <A
href="mailto:stycbackup@gmail.com">Contact Administrator</A></P>
<SCRIPT src="1338 -- Ugly Numbers.files/urchin.js"
type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript>_uacct="UA-790353-1";urchinTracker();</SCRIPT>
</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -