📄 2819 -- w的密码.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0035)http://poj.grids.cn/problem?id=2819 -->
<HTML><HEAD><TITLE>2819 -- W的密码</TITLE>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="2819 -- W的密码.files/poj.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="2819 -- W的密码.files/poj.js"></SCRIPT>
<META content="MSHTML 6.00.2900.2180" 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
style="BACKGROUND-IMAGE: url(images/header.jpg); BACKGROUND-REPEAT: no-repeat; TEXT-ALIGN: right"
vAlign=bottom align=middle colSpan=5 height=160>
<DIV style="MARGIN-BOTTOM: 0px"><IMG src="2819 -- W的密码.files/logopku.gif"
border=0> <IMG src="2819 -- W的密码.files/logo4.gif"
border=0></DIV></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://poj.grids.cn/bbs">Web Board</A><BR><A
href="http://poj.grids.cn/">Home Page</A><BR><A
href="http://poj.grids.cn/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://poj.grids.cn/problemlist">Problems</A><BR><A
href="http://poj.grids.cn/submit">Submit Problem</A><BR><A
href="http://poj.grids.cn/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://poj.grids.cn/register">Register</A><BR><A
href="http://poj.grids.cn/modifyuser">Update your info</A><BR><A
href="http://poj.grids.cn/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://poj.grids.cn/pastcontests">Past Contests</A><BR><A
href="http://poj.grids.cn/contests">Scheduled Contests</A><BR><A
href="http://poj.grids.cn/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://poj.grids.cn/register" target=_parent>Register</A><INPUT
type=hidden value=/problem?id=2819 name=url></FORM></TD></TR></TBODY></TABLE>
<TABLE width="100%" background="2819 -- W的密码.files/table_back.jpg" border=0>
<TBODY>
<TR>
<TD>
<P align=center><FONT color=blue size=5>W的密码</FONT> <BR>Time
Limit:1000MS Memory Limit:65536K<BR>Total Submit:872 Accepted:396
</P>
<P><FONT color=blue size=5>Description</FONT><BR><FONT
face="Times New Roman" size=3>加密一条信息需要三个整数码, k1, k2 和 k3。字符[a-i] 组成一组,
[j-r] 是第二组, 其它所有字符 ([s-z] 和下划线)组成第三组。 在信息中属于每组的字符将被循环地向左移动ki个位置。
每组中的字符只在自己组中的字符构成的串中移动。解密的过程就是每组中的字符在自己所在的组中循环地向右移动ki个位置。 <BR>例如对于信息
the_quick_brown_fox 以ki 分别为 2, 3 和 1蔼进行加密。加密后变成
_icuo_bfnwhoq_kxert。下图显示了右旋解密的过程。 <BR><BR><IMG
src="2819 -- W的密码.files/2819_1.png">
<BR><BR>观察在组[a-i]中的字符,我们发现{i,c,b,f,h,e}出现在信息中的位置为{2,3,7,8,11,17}。当k1=2右旋一次后,
上述位置中的字符变成{h,e,i,c,b,f}。下表显示了经过所有第一组字符旋转得到的中间字符串,然后是所有第二组,第三组旋转的中间字符串。在一组中变换字符将不影响其它组中字符的位置。
<BR><BR><IMG src=""> <BR><BR>所有输入字符串中只包含小写字母和下划线(_)。所有字符串最多有偿服务0个字符。ki
是1-100之间的整数。 <BR><BR><BR><BR><BR><BR><BR></FONT></P>
<P><FONT color=blue size=5>Input</FONT><BR><FONT face="Times New Roman"
size=3>输入包括一到多组数据。每个组前面一行包括三个整数 k1, k2 和
k3,后面是一行加密信息。输入的最后一行是由三个0组成的。</FONT></P>
<P><FONT color=blue size=5>Output</FONT><BR><FONT face="Times New Roman"
size=3>对于每组加密数据,输出它加密前的字符串。 <BR></FONT></P>
<P><FONT color=blue size=5>Sample Input</FONT><BR><FONT
face="Times New Roman" size=3><PRE>2 3 1
_icuo_bfnwhoq_kxert
1 1 1
bcalmkyzx
3 7 4
wcb_mxfep_dorul_eov_qtkrhe_ozany_dgtoh_u_eji
2 4 3
cjvdksaltbmu
0 0 0
</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Sample Output</FONT><BR><FONT
face="Times New Roman" size=3><PRE>the_quick_brown_fox
abcklmxyz
the_quick_brown_fox_jumped_over_the_lazy_dog
ajsbktcludmv</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Source</FONT><BR><FONT face="Times New Roman"
size=3><A
href="http://poj.grids.cn/searchproblem?field=source&key=1107">1107</A></FONT></P></TD></TR></TBODY></TABLE><FONT
color=#333399 size=3>
<P align=center>[<A
href="http://poj.grids.cn/submit?problem_id=2819">Submit</A>] [<A
href="javascript:history.go(-1)">Go Back</A>] [<A
href="http://poj.grids.cn/problemstatus?problem_id=2819">Status</A>]
[<A href="http://poj.grids.cn/bbs?problem_id=2819">Discuss</A>] </FONT></P>
<P><IMG height=30 src="2819 -- W的密码.files/home.gif" width=40 border=0><FONT
size=3><A href="http://poj.grids.cn/">Home Page</A> </FONT> <IMG
height=30 src="2819 -- W的密码.files/goback.gif" width=40 border=0><FONT size=3><A
href="javascript:history.go(-1)">Go Back</A> <IMG height=30
src="2819 -- W的密码.files/top.gif" width=40 border=0><A
href="http://poj.grids.cn/problem?id=2819#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:xiedipoj@yahoo.com">Contact Administrator</A></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -