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

📄 view code.mht

📁 HDUOJ_ACM题目集合~~希望各位能用得上
💻 MHT
📖 第 1 页 / 共 5 页
字号:
From: "Saved by Windows Internet Explorer 7"
Subject: View Code
Date: Thu, 27 Nov 2008 18:54:52 +0800
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----=_NextPart_000_0146_01C950C1.A1918AB0"
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049

This is a multi-part message in MIME format.

------=_NextPart_000_0146_01C950C1.A1918AB0
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://acm.hdu.edu.cn/viewcode.php?rid=917567

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>View Code</TITLE>
<META content=3D"HDOJ ACM ICPC OJ C C++ Pascal Java" name=3Dkeywords>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3Dgb2312><LINK media=3Dall=20
href=3D"http://acm.hdu.edu.cn/images/global.css" type=3Dtext/css=20
rel=3Dstylesheet><LINK media=3Dall =
href=3D"http://acm.hdu.edu.cn/css/diyinhead.css"=20
type=3Dtext/css rel=3Dstylesheet>
<SCRIPT src=3D"http://acm.hdu.edu.cn/js/global.js" =
type=3Dtext/javascript></SCRIPT>

<META content=3D"MSHTML 6.00.6001.18148" name=3DGENERATOR></HEAD>
<BODY><A name=3Dtop></A>
<TABLE style=3D"WORD-WRAP: break-word" cellSpacing=3D0 cellPadding=3D0 =
width=3D980=20
align=3Dcenter border=3D0>
  <TBODY>
  <TR>
    <TD=20
    style=3D"BORDER-RIGHT: #1a5cc8 1px solid; BORDER-TOP: #1a5cc8 1px =
solid; BORDER-LEFT: #1a5cc8 1px solid; BORDER-BOTTOM: #1a5cc8 1px solid" =

    align=3Dmiddle width=3D"100%"><A =
href=3D"http://acm.hdu.edu.cn/"><IMG height=3D116=20
      src=3D"http://acm.hdu.edu.cn/images/banner.jpg" width=3D"100%"=20
  border=3D0></A></TD></TR>
  <TR>
    <TD=20
    style=3D"BORDER-RIGHT: #1a5cc8 1px solid; BORDER-TOP: #1a5cc8 1px =
solid; BORDER-LEFT: #1a5cc8 1px solid; BORDER-BOTTOM: #1a5cc8 1px =
solid">
      <TABLE cellSpacing=3D0 cellPadding=3D1 width=3D"100%">
        <TBODY>
        <TR class=3Dbanner align=3Dmiddle bgColor=3D#1a5cc8 height=3D25>
          <TD>Online Judge</TD>
          <TD>Problem Set</TD>
          <TD>Authors</TD>
          <TD>Online Contests</TD>
          <TD>Exercise Author</TD></TR>
        <TR style=3D"FONT-SIZE: 16px" align=3Dmiddle>
          <TD vAlign=3Dtop width=3D"20%"><A =
href=3D"http://acm.hdu.edu.cn/">Home=20
            Page</A><BR><A=20
            =
href=3D"http://acm.hdu.edu.cn/notification.php">Notification</A><BR><A=20
            href=3D"http://acm.hdu.edu.cn/faq.php">F.A.Q</A><BR><A=20
            href=3D"http://acm.hdu.edu.cn/forum">Forum</A><BR><A=20
            href=3D"http://acm.hdu.edu.cn/admin">Administration</A> =
</TD>
          <TD vAlign=3Dtop width=3D"20%">
            <FORM action=3D/search.php method=3Dget><A=20
            =
href=3D"http://acm.hdu.edu.cn/listproblem.php?vol=3D1">Problem=20
            Archive</A><BR><A =
href=3D"http://acm.hdu.edu.cn/submit.php">Submit=20
            Solution</A><BR><A =
href=3D"http://acm.hdu.edu.cn/status.php">Realtime=20
            Judge Status</A><BR><INPUT type=3Dhidden value=3Dproblem=20
            name=3Dfield><INPUT class=3Dtext60 name=3Dkey>&nbsp;<INPUT =
class=3Dbutton40 type=3Dsubmit value=3DSearch>=20
            </FORM></TD>
          <TD vAlign=3Dtop width=3D"20%">
            <FORM action=3D/search.php method=3Dget><A=20
            href=3D"http://acm.hdu.edu.cn/register.php">Register New=20
            Author</A><BR><A =
href=3D"http://acm.hdu.edu.cn/modifyuser.php">Update=20
            Your Information</A><BR><A=20
            href=3D"http://acm.hdu.edu.cn/ranklist.php">Authors=20
            Ranklist</A><BR><INPUT type=3Dhidden value=3Dauthor =
name=3Dfield><INPUT=20
            class=3Dtext60 name=3Dkey>&nbsp;<INPUT class=3Dbutton40 =
type=3Dsubmit value=3DSearch>=20
            </FORM></TD>
          <TD vAlign=3Dtop width=3D"20%"><A=20
            =
href=3D"http://acm.hdu.edu.cn/contests/contest_show.php?cid=3D158"=20
            ?>Next Contest Time<BR><SPAN=20
            style=3D"FONT-SIZE: 14px; COLOR: red">2008-12-06 12:00:00=20
            (GMT+8)</SPAN></A><BR><A=20
            =
href=3D"http://acm.hdu.edu.cn/contests/contest_list.php?type=3Dscheduled"=
>Scheduled=20
            Contests</A><BR><A=20
            =
href=3D"http://acm.hdu.edu.cn/contests/contest_list.php?type=3Dpassed">Pa=
ssed=20
            Contests</A><BR><A style=3D"COLOR: red"=20
            href=3D"http://acm.hdu.edu.cn/diy/contest_list.php">DIY =
Contests !</A>=20
          </TD>
          <TD width=3D"20%">
            <DIV style=3D"FONT-SIZE: 16px; WIDTH: 150px" align=3Dleft><A =

            =
href=3D"http://acm.hdu.edu.cn/userstatus.php?user=3Djimdavis"><IMG=20
            height=3D18 alt=3DAuthor =
src=3D"http://acm.hdu.edu.cn/images/user.png"=20
            width=3D18 border=3D0> monster_chen</A><BR><B=20
            style=3D"FONT-SIZE: 16px; FONT-FAMILY: Arial"><A=20
            href=3D"http://acm.hdu.edu.cn/listmsg.php"><IMG height=3D18 =
alt=3DMail=20
            src=3D"http://acm.hdu.edu.cn/images/mail.png" width=3D18 =
border=3D0> Mail=20
            0</A><A =
href=3D"http://acm.hdu.edu.cn/listmsg.php?type=3Dnew">(<FONT=20
            color=3Dred>0</FONT>)</A></B><BR><A=20
            href=3D"http://acm.hdu.edu.cn/sendmsg.php"><IMG height=3D18=20
            alt=3D"Write New Mail"=20
            src=3D"http://acm.hdu.edu.cn/images/writemail.png" =
width=3D18 border=3D0>=20
            Write New Mail</A><BR><A=20
            =
href=3D"http://acm.hdu.edu.cn/userloginex.php?action=3Dlogout"><IMG=20
            height=3D18 alt=3D"Sign Out"=20
            src=3D"http://acm.hdu.edu.cn/images/signout.png" width=3D18 =
border=3D0>=20
            Sign Out</A></DIV></TD></TR></TBODY></TABLE></TD></TR>
  <SCRIPT src=3D"http://acm.hdu.edu.cn/js/cpp_coderender.js"=20
  type=3Dtext/javascript></SCRIPT>

  <SCRIPT src=3D"http://acm.hdu.edu.cn/js/utility.js"=20
  type=3Dtext/javascript></SCRIPT>

  <TR>
    <TD style=3D"WIDTH: 980px; WORD-BREAK: break-all">
      <H1>View Code</H1>
      <DIV=20
      style=3D"BORDER-RIGHT: #b7cbff 1px dashed; BORDER-TOP: #b7cbff 1px =
dashed; FONT-SIZE: 12px; BORDER-LEFT: #b7cbff 1px dashed; BORDER-BOTTOM: =
#b7cbff 1px dashed; BACKGROUND-COLOR: #f4fbff">
      <DIV=20
      style=3D"PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: =
6px; PADDING-TOP: 6px; BORDER-BOTTOM: #b7cbff 1px dashed; FONT-FAMILY: =
Arial"=20
      align=3Dcenter><B><FONT color=3Dgreen>Problem : <A=20
      href=3D"http://acm.hdu.edu.cn/showproblem.php?pid=3D1312" =
target=3D_blank>1312 (=20
      Red and Black )</A> &nbsp;&nbsp;&nbsp;&nbsp;Judge Status : <FONT=20
      color=3Dred>Accepted</FONT><BR>RunId :=20
      917567&nbsp;&nbsp;&nbsp;&nbsp;Language : =
C++&nbsp;&nbsp;&nbsp;&nbsp;Author=20
      : <A href=3D"http://acm.hdu.edu.cn/userstatus.php?user=3Djimdavis" =

      target=3D_blank>jimdavis</A><BR>Code Render Status : <FONT=20
      color=3D#ff00ff>Rendered By HDOJ C++ Code Rander Version 0.01=20
      Beta</FONT></FONT></B></DIV><TEXTAREA id=3Dusercode =
style=3D"DISPLAY: none; TEXT-ALIGN: left">#include &lt;iostream&gt;
#include &lt;queue&gt;
#include &lt;string&gt;
using namespace std;

class node
{
public:
    int x, y;
};

char a[21][21];
int x, y, h, w, t;
int dir[4][2] =3D {{0,1},{0,-1},{1,0},{-1,0}};

void dfs()
{
    int i;
    node n, e;
    queue&lt;node&gt; q;
    n.x=3Dx; n .y=3Dy;
    q.push(n);
    while (!q.empty())
    {
        n =3D q.front(); q.pop();
        if (a[n.x][n.y] !=3D '#')
        {
            t++;
            a[n.x][n.y] =3D '#';
        }
        else
            continue;
        for (i =3D 0; i &lt; 4; i++)
        {
            e.x=3Dn.x+dir[i][0];
            e.y=3Dn.y+dir[i][1];
            if (e.x&gt;=3D0 &amp;&amp; e.y&gt;=3D0 &amp;&amp; e.x&lt;h =
&amp;&amp; e.y&lt;w)
            {
                q.push(e);
            }
        }
    }
}

int main()
{
    int i, j, k;
    while (cin&gt;&gt;w&gt;&gt;h &amp;&amp; (w!=3D0 &amp;&amp; h!=3D0))

⌨️ 快捷键说明

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