﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-zjr1994-cpp</title><link>http://www.cppblog.com/zjr1994-cpp/</link><description /><language>zh-cn</language><lastBuildDate>Tue, 09 Jun 2026 21:29:58 GMT</lastBuildDate><pubDate>Tue, 09 Jun 2026 21:29:58 GMT</pubDate><ttl>60</ttl><item><title>JSOI2010A1</title><link>http://www.cppblog.com/zjr1994-cpp/archive/2010/03/12/109568.html</link><dc:creator>zjr1994-cpp</dc:creator><author>zjr1994-cpp</author><pubDate>Fri, 12 Mar 2010 14:07:00 GMT</pubDate><guid>http://www.cppblog.com/zjr1994-cpp/archive/2010/03/12/109568.html</guid><wfw:comment>http://www.cppblog.com/zjr1994-cpp/comments/109568.html</wfw:comment><comments>http://www.cppblog.com/zjr1994-cpp/archive/2010/03/12/109568.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/zjr1994-cpp/comments/commentRss/109568.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/zjr1994-cpp/services/trackbacks/109568.html</trackback:ping><description><![CDATA[<meta http-equiv="CONTENT-TYPE" content="text/html; charset=" utf-8="">
<title></title>
<meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)">
<style type="text/css">
<!--
@page { size: 21cm 29.7cm; margin: 2cm }
P { margin-bottom: 0.21cm }
-->
</style>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><font style="font-size: 16pt;" size="4"><strong>一、&#8220;访问&#8221;艺术馆</strong></font></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>源程序名</strong> 　　　GALLERY.???
(<font size="2">PAS</font>,<font size="2">C</font>,<font size="2">CPP</font>)</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>输入文件名</strong>　　 GALLERY.IN</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>输出文件名 &nbsp; &nbsp; &nbsp;     </strong>GALLERY.OUT</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>问题描述</strong></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">	经过数月的精心准备，Peer
Brelstet，一个出了名的盗画者，准备开始他的下一个行动。艺术馆的结构，每条走廊要么分叉为两条走廊，要么通向一个展览室。Peer知道每个展室里藏画的数量，并且他精确测量了通过每条走廊的时间。由于经验老到，他拿下一幅画需要5秒的时间。你的任务是编一个程序，计算在警察赶来前，他最多能偷到多少幅画。</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>输入</strong></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">	第1行是警察赶到的时间，以秒为单位。第2行描述了艺术馆的结构，是一串非负整数，成对地出现：每一对的第一个数是走过一条走廊的时间，第2个数是它末端的藏画数量：如果第2个数
是0那么说明这条走廊分叉为两条另外的走廊。数据按照深度优先的次序给出，请看样例。</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">	一个展室最多有20幅画。通过每个走廊的时间不超过20秒。艺术馆最多有100个展室。警察赶到的时间在10分钟以内。<strong><br></strong></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>输出</strong></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">	输出一行一个数，即画的数量。</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><strong>样例</strong></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">GALLERY.IN</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">60</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">7 0 8 0 3 1
14 2 10 0 12 4 6 2</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;"><br></p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">GALLERY.OUT</p>
<p style="margin-bottom: 0cm; font-family: 微软雅黑;">2</p>
<img style="width: 516px; height: 386px;" src="http://www.cppblog.com/images/cppblog_com/zjr1994-cpp/A1_1.jpg" border="0">(&#8221;艺术馆&#8220;示意图)   <img src ="http://www.cppblog.com/zjr1994-cpp/aggbug/109568.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/zjr1994-cpp/" target="_blank">zjr1994-cpp</a> 2010-03-12 22:07 <a href="http://www.cppblog.com/zjr1994-cpp/archive/2010/03/12/109568.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>