<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
 <title><![CDATA[【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <link><![CDATA[https://bbs.oifans.cn/read-oifans-tid-1535.html]]></link>
 <description><![CDATA[最新回复]]></description>
 <copyright><![CDATA[Copyright(C) OI爱好者（OIFans.cn）]]></copyright>
 <generator><![CDATA[http://www.phpwind.com]]></generator>
 <lastBuildDate><![CDATA[Tue, 09 Jun 2026 05:03:51 +0000]]></lastBuildDate>
 <ttl><![CDATA[60]]></ttl>
 <pubDate><![CDATA[Mon, 22 Oct 2007 03:30:08 +0000]]></pubDate>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[感谢 hjwz]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12770]]></link>
 <author><![CDATA[webmaster@oifans.cn (czhijun79)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Mon, 22 Oct 2007 03:30:08 +0000]]></pubDate>
</item>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[楼上的你抄我]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12737]]></link>
 <author><![CDATA[webmaster@oifans.cn (hjwz)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Sun, 21 Oct 2007 23:16:12 +0000]]></pubDate>
</item>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[第十三届全国青少年信息学奥林匹克联赛初赛试题
（ 普及组 Pascal 语言 二小时完成）
●&nbsp; &nbsp; ● 全部试题答案均要求写在答卷纸上，写在试卷纸上一律无效 ●●

一、&nbsp; &nbsp; 单项选择题（共20题，每题1.5分，共计30分。每题有且仅有一个正确答案。）

1．&nbsp; &nbsp; 在以下各项中，（&nbsp; ）不是CPU的组成部分。
A．控制器&nbsp; &nbsp; &nbsp; B．运算器&nbsp; &nbsp;  C．寄存器&nbsp; &nbsp; &nbsp; D．主板

2．在关系数据库中，存放在数据库中的数据的逻辑结构以（&nbsp; ）为主。
A．二叉树&nbsp; &nbsp; &nbsp; B．多叉树&nbsp; &nbsp;  C．哈希表&nbsp; &nbsp; &nbsp; D．二维表

3．在下列各项中，只有（&nbsp; ）不是计算机存储容量的常用单位。
A．Byte&nbsp; &nbsp; &nbsp; &nbsp; B．KB&nbsp; &nbsp; &nbsp; &nbsp; C．UB&nbsp; &nbsp; &nbsp; &nbsp;  D．TB

4．ASCII码的含义是（&nbsp; ）。
A．二→十进制转换码&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B．美国信息交换标准代码 
C．数字的二进制编码&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D．计算机可处理字符的唯一编码

5．一个完整的计算机系统应包括（&nbsp; ）。
A．系统硬件和系统软件&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B．硬件系统和软件系统 
C．主机和外部设备&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D．主机、键盘、显示器和辅助存储器

6．IT的含义是（&nbsp; ）。
A．通信技术&nbsp; &nbsp;  B．信息技术&nbsp; &nbsp;  C．网络技术&nbsp; &nbsp;  D．信息学

7．LAN的含义是（&nbsp; ）。
A．因特网&nbsp; &nbsp; &nbsp;  B．局域网&nbsp; &nbsp; &nbsp;  C．广域网&nbsp; &nbsp; &nbsp;  D．城域网

8．冗余数据是指可以由其它数据导出的数据。例如，数据库中已存放了学生的数学、语文和英语的三科成绩，如果还存放三科成绩的总分，则总分就可以看作冗余数据。冗余数据往往会造成数据的不一致。例如，上面4个数据如果都是输入的，由于操作错误使总分不等于三科成绩之和，就会产生矛盾。下面关于冗余数据的说法中，正确的是（&nbsp; ）。
A．应该在数据库中消除一切冗余数据
B．用高级语言编写的数据处理系统，通常比用关系数据库编写的系统更容易消除冗余数据
C．为了提高查询效率，在数据库中可以保留一些冗余数据，但更新时要做相容性检验
D．做相容性检验会降低效率，可以不理睬数据库中的冗余数据

9．在下列各软件，不属于NOIP竞赛（复赛）推荐使用的语言环境有（&nbsp; ）。
A．gcc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; B．g++&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C．Turbo C&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; D．Free Pascal

10．以下断电后仍能保存数据的有（&nbsp; ）。
A．硬盘&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B．高速缓存&nbsp; &nbsp; &nbsp;  C．显存&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D．RAM
11．在下列关于计算机语言的说法中，正确的有（&nbsp; ）。
A．高级语言比汇编语言更高级，是因为它的程序的运行效率更高
B．随着Pascal、C等高级语言的出现，机器语言和汇编语言已经退出了历史舞台
C．高级语言比汇编语言程序更容易从一种计算机上移植到另一种计算机上
D．C是一种面向对象的高级计算机语言

12．近20年来，许多计算机专家都大力推崇递归算法，认为它是解决较复杂问题的强有力的工具。在下列关于递归算法的说法中，正确的是（&nbsp; ）。
A．在1977年前后形成标准的计算机高级语言“FORTRAN77”禁止在程序使用递归，原因之一是该方法可能会占用更多的内存空间
B．和非递归算法相比，解决同一个问题，递归算法一般运行得更快一些
C．对于较复杂的问题，用递归方式编程一般比非递归方式更难一些
D．对于已经定义好的标准数学函数 sin(x)，应用程序中的语句“y=sin(sin(x));”就是一种递归调用

13．一个无法靠自身的控制终止的循环成为“死循环”，例如，在C语言程序中，语句“while(1) printf(“*”);”就是一个死循环，运行时它将无休止地打印*号。下面关于死循环的说法中，只有（&nbsp; ）是正确的。
A．不存在一种算法，对任何一个程序及相应的输入数据，都可以判断是否会出现死循环，因而，任何编译系统都不做死循环检查
B．有些编译系统可以检测出死循环
C．死循环属于语法错误，既然编译系统能检查各种语法错误，当然也应该能检查出死循环
D．死循环与多进程中出现的“死锁”差不多，而死锁是可以检测的，因而，死循环也可以检测的

14．在Pascal语言中，表达式 （23 or 2 xor 5）的值是（&nbsp; ）。
A．18&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B．1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  C．23&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; D．32

15．在Pascal语言中，判断整数a等于0或b等于0或c等于0的正确的条件表达式是（&nbsp; ）。
A．not ((a&lt;&gt;0) or&nbsp; (b&lt;&gt;0) or&nbsp; (c&lt;&gt;0))
B．not ((a&lt;&gt;0) and (b&lt;&gt;0) and (c&lt;&gt;0))
C．not ((a=0) and (b=0)) or (c&lt;&gt;0)
D．(a=0) and (b=0) and (c=0)

16．地面上有标号为A、B、C的三根柱，在A柱上放有10个直径相同中间有孔的圆盘，从上到下依次编号为1，2，3……，将A柱上的部分盘子经过B柱移入C柱，也可以在B柱上暂存。如果B柱上的操作记录为“进、进、出、进、进、出、出、进、进、出、进、出、出”。那么，在C柱上，从下到上的编号为（&nbsp; ）。
A．2 4 3 6 5 7&nbsp; &nbsp; &nbsp; &nbsp;  B．2 4 1 2 5 7&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C．2 4 3 1 7 6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; D．2 4 3 6 7 5

17．与十进制数1770对应的八进制数是（&nbsp; ）。
A．3350&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B．3351&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  C．3352&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D．3540


18．设A=B=True，C=D=False，一下逻辑运算表达式值为假的有（&nbsp; ）。
A．(﹁A∧B)∨(C∧D∨A)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B．﹁(((A∧B)∨C)∧D)&nbsp; 
C．A∧(B∨C∨D)∨D&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  D．(A∧(D∨C))∧B

19．(2070)16 + (34)8 的结果是（&nbsp; ）。
A．（8332）10&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; B．（208A）16&nbsp; &nbsp; &nbsp;  C．（100000000110）2&nbsp; &nbsp; &nbsp; &nbsp; D．(20212)8

20．已知7个节点的二叉树的先根遍历是1 2 4 5 6 3 7（数字为节点的编号，以下同），中根遍历是4 2 6 5 1 7 3，则该二叉树的后根遍历是（&nbsp; ）。
A．4 6 5 2 7 3 1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; B．4 6 5 2 1 3 7&nbsp; &nbsp; &nbsp; &nbsp; C．4 2 3 1 5 4 7&nbsp; &nbsp; &nbsp; &nbsp;  D．4 6 5 3 1 7 2

二、问题求解（共2题，每题5分，共计10分）。

1、（子集划分）将n个数（1，2，…，n）划分成r个子集。每个数都恰好属于一个子集，任何两个不同的子集没有共同的数，也没有空集。将不同划分方法的总数记为S(n,r)。例如，S(4,2)=7，这7种不同的划分方法依次为{(1),(234)}，{(2),(134)}，{(3),(124)}，{(4),(123)}，{(12),(34)}，{(13),(24)}，{(14),(23)}。当n=6，r=3时，S(6,3)=______________。
（提示：先固定一个数，对于其余的5个数考虑S(5,3)与S(5,2)，再分这两种情况对原固定的数进行分析。）

2、（最短路线）某城市的街道是一个很规整的矩形网络（见下图），有7条南北向的纵街，5条东西向的横街。现要从西南角的A走到东北角的B，最短的走法共有多少种？___________
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  B
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
A

三、阅读程序写结果（共4题，每题8分，共计32分。）
1、program j301;
var&nbsp; &nbsp;  i,a,b,c,x,y:integer;
&nbsp; &nbsp; &nbsp; &nbsp; p:array[0..4] of integer;
begin
&nbsp; &nbsp; &nbsp; &nbsp; y:=20;
&nbsp; &nbsp; &nbsp; &nbsp; for i:=0 to 4 do read(p<i>);
&nbsp; &nbsp; &nbsp; &nbsp; readln;
&nbsp; &nbsp; &nbsp; &nbsp; a:=(p[0]+p[1])+(p[2]+p[3]+p[4]) div 7;
&nbsp; &nbsp; &nbsp; &nbsp; b:=p[0]+p[1] div ((p[2]+p[3]) div p[4]);
&nbsp; &nbsp; &nbsp; &nbsp; c:=p[0]*p[1] div p[2];
&nbsp; &nbsp; &nbsp; &nbsp; x:=a+b-p[(p[3]+3) mod 4];
&nbsp; &nbsp; &nbsp; &nbsp; if (x&gt;10)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; then y:=y+(b*100-a) div (p[p[4] mod 3]*5)
&nbsp; &nbsp; &nbsp; &nbsp; else
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; y:=y+20+(b*100-c) div (p[p[4] mod 3]*5);
&nbsp; &nbsp; &nbsp; &nbsp; writeln(x,&#39;,&#39;,y);
end.
{注：本例中，给定的输入数据可以避免分母为0或数组元素下表越界。}
输入：6 6 5 5 3&nbsp; 输出：______________________

2、program j302;
var&nbsp; &nbsp;  a,b:integer;
var&nbsp; &nbsp;  x,y:^integer;
procedure fun(a,b:integer);
var&nbsp; &nbsp;  k:integer;
begin&nbsp;  k:=a; a:=b; b:=k; end;
begin
&nbsp; &nbsp; &nbsp; &nbsp; a:=3; b:=6;
&nbsp; &nbsp; &nbsp; &nbsp; x:=@a; y:=@b;
&nbsp; &nbsp; &nbsp; &nbsp; fun(x^,y^);
&nbsp; &nbsp; &nbsp; &nbsp; writeln(a,&#39;,&#39;,b);
end.
输出：_______________________________

3、program j303;
var&nbsp; &nbsp;  a1:array[1..50] of integer;
var&nbsp; &nbsp;  i,j,t,t2,n,n2:integer;
begin
&nbsp; &nbsp; &nbsp; &nbsp; n:=50;
&nbsp; &nbsp; &nbsp; &nbsp; for i:=1 to n do a1<i>:=0;
&nbsp; &nbsp; &nbsp; &nbsp; n2:=round(sqrt(n));
&nbsp; &nbsp; &nbsp; &nbsp; for i:=2 to n2 do
&nbsp; &nbsp; &nbsp; &nbsp; if (a1<i>=0) then
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t2:=n div i;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for j:=2 to t2 do a1[i*j]:=1;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;
&nbsp; &nbsp; &nbsp; &nbsp; t:=0;
&nbsp; &nbsp; &nbsp; &nbsp; for i:=2 to n do
&nbsp; &nbsp; &nbsp; &nbsp; if (a1<i>=0) then
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write(i:4); inc(t);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (t mod 10=0) then writeln;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;
&nbsp; &nbsp; &nbsp; &nbsp; writeln;
end.
输出：_____________________________________________
&nbsp; &nbsp; &nbsp; _____________________________________________

4、Program j304;
Type str1=string[100];
&nbsp; &nbsp; Str2=string[200];
Var
&nbsp; &nbsp; S1:str1; s2:str2;
Function isalpha(c:char):Boolean;
Var i:integer;
Begin
&nbsp; &nbsp; i:=ord(c);
&nbsp; &nbsp; if ((i&gt;=65) and (i&lt;=90)) or ((i&gt;=97) and (i&lt;=122)) then
&nbsp; &nbsp;&nbsp; isalpha:=true
&nbsp; &nbsp; else isalpha:=false;
end;
function isdigit(c:char):Boolean;
var i:integer;
begin
&nbsp; &nbsp; i:=ord(c);&nbsp; if (i&gt;=48) and (i&lt;=57) then isdigit:=true
&nbsp; &nbsp; else isdigit:=false;
end;
procedure expand(s1:str1;var s2:str2);
var i,j:integer; a,b,c:char;
begin
&nbsp; &nbsp; j:=1; c:=char(1); i:=0;
&nbsp; &nbsp; while (i&lt;=ord(s1[0])) do
&nbsp; &nbsp; begin inc(i); c:=s1<i>;
&nbsp; &nbsp; &nbsp; if c=&#39;-&#39; then begin {1}
&nbsp; &nbsp; &nbsp; &nbsp; a:=s1[i-1]; b:=s1[i+1];
&nbsp; &nbsp; &nbsp; &nbsp; if (isalpha(a) and isalpha(b)) or (isdigit(a) and isdigit(b)) then begin
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dec(j);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (ord(upcase(a))&lt;ord(upcase(s1[i+1]))) do
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; begin
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s2[j]:=a; inc(j); inc(a); end;
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  end
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else
begin s2[j]:=c; inc(j); end;
end{1}
else begin s2[j]:=c; inc(j); end; end; s2[0]:=char(j-2); end;
begin readln(s1); expand(s1,s2); writeln(s2);
end.

输入：wer2345d-h454-82qqq&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  输出：__________________________
四、完善程序（前4空，每空2.5分，后6空，每空3分，共28分）。
1、（求字符的逆序）下面的程序的功能是输入若干行字符串，每输入一行，就按逆序输出该行，最后键入-1终止程序。
&nbsp; &nbsp; 请将程序补充完整。
Program j401;
type str1=string[100];
var line:str1; kz:integer;
procedure reverse(var s:str1);
var I,j:integer; t:char;
begin
&nbsp; &nbsp; i:=1; j:=length(s);
&nbsp; &nbsp; while (i&lt;j) do begin
&nbsp; &nbsp; t:=s<i>; s<i>:=s[j]; s[j]:=t;
&nbsp; &nbsp;&nbsp; ;&nbsp; ;
&nbsp; &nbsp; end;
end;
begin
&nbsp; &nbsp; writeln(‘continue? -1 for end.’);
&nbsp; &nbsp; readln(kz);
&nbsp; &nbsp; while ( )do
&nbsp; &nbsp; begin
&nbsp; &nbsp; readln(line);
&nbsp; &nbsp;&nbsp; ;
&nbsp; &nbsp; writeln(line);
&nbsp; &nbsp; writeln(‘continue? -1 for end.’);
&nbsp; &nbsp; readln(kz);
&nbsp; &nbsp; end;
end.

2&nbsp; &nbsp; 2&nbsp; &nbsp; 3&nbsp; &nbsp; 3
2&nbsp; &nbsp; -1&nbsp; &nbsp; 1&nbsp; &nbsp; 3
4&nbsp; &nbsp; 1&nbsp; &nbsp; 1&nbsp; &nbsp; 5
4&nbsp; &nbsp; 4&nbsp; &nbsp; 5&nbsp; &nbsp; 5
 2、（棋盘覆盖问题）在一个2k×2 k个方格组成的棋盘中恰有一个方格与其它方格不同（图中标记为-1的方格），称之为特殊方格。现用L型（占3个小方格）纸片覆盖棋盘上除特殊方格的所有部分，各纸片不得重叠，于是，用到的纸片数恰好是（4 k-1）/3。在下表给出的一个覆盖方案中，k=2，相同的3各数字构成一个纸片。
&nbsp; &nbsp; 下面给出的程序使用分治法设计的，将棋盘一分为四，依次处理左上角、右上角、左下角、右下角，递归进行。请将程序补充完整。






Program j402;
type arr1=array[1..65] of integer;
&nbsp; &nbsp; arr2=array[1..65] of arr1;
var board:arr2; tile:integer; size,dr,dc:integer;
procedure chessboard(tr,tc:integer; dr,dc:integer; var size:integer);
var t,s:integer;
begin
&nbsp; &nbsp; if (size=1) then&nbsp; ;
&nbsp; &nbsp; t:=tile; inc(tile);
&nbsp; &nbsp; s:=size div 2;
&nbsp; &nbsp; if&nbsp;  then chessboard(tr,tc,dr,dc,s) else begin
&nbsp; &nbsp; &nbsp; &nbsp; board[tr+s-1]:=t;
 ;
end;
if (dr&lt;tr+s) and (dc&gt;=tc+s) then chessboard(tr,tc+s,dr,dc,s)
&nbsp; &nbsp; else begin board[tr+s-1][tc+s]:=t;
&nbsp; &nbsp;&nbsp; ; end;
if (dr&gt;=tr+s) and (dc&lt;tc+s) then chessboard(tr+s,tc+s,dr,dc,s) else begin
&nbsp; &nbsp; board[tr+s][tc+s]:=t;
&nbsp; &nbsp;&nbsp; ; end;
if (dr&gt;=tr+s) and (dc&gt;=tc+s) then chessboard(tr+s,tc+s,dr,dc,s)
else begin board[tr+s][tc+s]:=t;
 ; end;
end;
procedure prt1(n:integer);
var I,j:integer;
begin
&nbsp; &nbsp; for I:=1 to n do begin
&nbsp; &nbsp; for j:=1 to n do write(board<i>[j]:3);
&nbsp; &nbsp; writeln;
end;
end;
begin
&nbsp; &nbsp; writeln(‘input size(4/8/16/64):’);
&nbsp; &nbsp; readln(size); writeln(‘input the position of special block(x,y):’);
&nbsp; &nbsp; readln(dr,dc);&nbsp; &nbsp; board[dr][dc]:=-1;
&nbsp; &nbsp; tile:=1;&nbsp; &nbsp; chessboard(1,1,dr,dc,size); prt1(size);
end.
NOIP2007年普及组（Pascal语言）参考答案与评分标准

一、单项选择题：（每题1.5分） 
题号&nbsp; &nbsp; 1&nbsp; &nbsp; 2&nbsp; &nbsp; 3&nbsp; &nbsp; 4&nbsp; &nbsp; 5&nbsp; &nbsp; 6&nbsp; &nbsp; 7&nbsp; &nbsp; 8&nbsp; &nbsp; 9&nbsp; &nbsp; 10
答案&nbsp; &nbsp; D&nbsp; &nbsp; D&nbsp; &nbsp; C&nbsp; &nbsp; B&nbsp; &nbsp; B&nbsp; &nbsp; B&nbsp; &nbsp; B&nbsp; &nbsp; C&nbsp; &nbsp; C&nbsp; &nbsp; A
题号&nbsp; &nbsp; 11&nbsp; &nbsp; 12&nbsp; &nbsp; 13&nbsp; &nbsp; 14&nbsp; &nbsp; 15&nbsp; &nbsp; 16&nbsp; &nbsp; 17&nbsp; &nbsp; 18&nbsp; &nbsp; 19&nbsp; &nbsp; 20
答案&nbsp; &nbsp; C&nbsp; &nbsp; A&nbsp; &nbsp; A&nbsp; &nbsp; A&nbsp; &nbsp; B&nbsp; &nbsp; D&nbsp; &nbsp; C&nbsp; &nbsp; D&nbsp; &nbsp; A&nbsp; &nbsp; A

二、问题求解：（每题 5分） 
1．90&nbsp;  2．210 

三、阅读程序写结果 
1. 15, 46（对1个数给4分，无逗号扣1分）
2.&nbsp; 3, 6 
3.&nbsp; 2&nbsp; 3&nbsp; 5&nbsp; 7&nbsp; 11&nbsp; 13&nbsp; 17&nbsp; 19&nbsp; 23&nbsp; 29 
&nbsp; 31&nbsp; 37&nbsp; 41&nbsp; 43&nbsp; 47 
4.&nbsp; wer2345defgh45456782qqq 

四、完善程序(前4空（①--④），每空2.5分，后6空（⑤--⑩），每空3分) 
（说明：以下各程序填空可能还有一些等价的写法，各省可请本省专家审定和上机验证，不一定上报科学委员会审查） 
1．
①&nbsp; inc(i) 或i:=i+1 
②&nbsp; dec(j) 或 j:=j-1
③&nbsp; kz&lt;&gt;-1
④&nbsp; reverse(line) 
2. 
⑤ exit
⑥ (dr&lt;tr+s)and(dc&lt;tc+s) 
⑦ chessboard(tr,tc,tr+s-1,tc+s-1,s)
⑧ chessboard(tr,tc+s,tr+s-1,tc+s,s)
⑨ chessboard(tr+s,tc,tr+s,tc+s-1,s)
⑩ chessboard(tr+s,tc+s,tr+s,tc+s,s)]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12694]]></link>
 <author><![CDATA[webmaster@oifans.cn (lhq5069909)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Sun, 21 Oct 2007 11:20:50 +0000]]></pubDate>
</item>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[第十三届全国青少年信息学奥林匹克联赛初赛试题+答案 pascal版
里面还有阅读程序和完善程序的pas文件

ps:普及组的]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12675]]></link>
 <author><![CDATA[webmaster@oifans.cn (hjwz)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Sun, 21 Oct 2007 08:42:26 +0000]]></pubDate>
</item>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[NOIP2007年普及组（Pascal语言）参考答案与评分标准 

一、单项选择题：（每题1.5分） 
 1. D&nbsp;  2. D&nbsp;  3. C&nbsp; &nbsp; 4. B&nbsp;  5. B&nbsp; &nbsp; 6.B&nbsp; &nbsp; 7. B&nbsp; &nbsp; 8. C&nbsp;  
 9. C&nbsp;  10. A 
11. C&nbsp;  12. A&nbsp; 13. A&nbsp; 14. A&nbsp;  15. B&nbsp;  16. D&nbsp; 17. C&nbsp;  18. D&nbsp;  
19. A&nbsp;  20. A 
二、问题求解：（每题 5分） 
 1．90 
 2．210 
三、阅读程序写结果 
 1. 15, 46（对1个数给4分，无逗号扣1分） 
 2.&nbsp; 3, 6 
3.&nbsp; 2&nbsp;  3&nbsp;  5&nbsp;  7&nbsp;  11&nbsp; 13&nbsp; 17&nbsp; 19&nbsp; 23&nbsp; 29 
&nbsp; 31&nbsp; 37&nbsp; 41&nbsp; 43&nbsp; 47 
4.&nbsp; wer2345defgh45456782qqq 
四、完善程序(前4空（①--④），每空2.5分，后6空（⑤--⑩），每空3分) 
（说明：以下各程序填空可能还有一些等价的写法，各省可请本省专家审定和上机验证，不一定上报科学委员会审查） 
 1．①&nbsp; inc(i) 或i:=i+1&nbsp; 
 ②&nbsp; dec(j) 或 j:=j-1 
&nbsp; &nbsp; ③&nbsp; kz&lt;&gt;-1 
④&nbsp; reverse(line)&nbsp; 
2.&nbsp; ⑤ exit 
⑥ (dr&lt;tr+s)and(dc&lt;tc+s)&nbsp; 
⑦ chessboard(tr,tc,tr+s-1,tc+s-1,s) 
⑧ chessboard(tr,tc+s,tr+s-1,tc+s,s) 
⑨ chessboard(tr+s,tc,tr+s,tc+s-1,s) 
⑩ chessboard(tr+s,tc+s,tr+s,tc+s,s)]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12660]]></link>
 <author><![CDATA[webmaster@oifans.cn (xiejun)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Sun, 21 Oct 2007 06:50:18 +0000]]></pubDate>
</item>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[第十三届全国青少年信息学奥林匹克联赛（Noip2007）提高组初赛试题，刚打的。

要是要的话也可以把OIFANS.CN的加上去，但是可别把我原来写的删了哦

支持你们。

我的可是最完整的咯。]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12659]]></link>
 <author><![CDATA[webmaster@oifans.cn (xxjx)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Sun, 21 Oct 2007 06:39:52 +0000]]></pubDate>
</item>
<item>
 <title><![CDATA[Re:【公告】悬赏收集第十三届（NOIP2007）全国青少年奥林匹克信息学联赛初赛试题]]></title>
 <description><![CDATA[这是别人的,不是完全的试题.
先放上来,找到完整的再发上来.

选择: 
1. 在以下各项中, ( ) 不是CPU的组成部分 
A. 控制器 
B. 运算器 
C. 寄存器 
D. 主板 
E. 算术逻辑单元(ALU) 

2. 在关系数据库中, 存放在数据库中的数据的逻辑结构以( )为主 
A. 二叉树 
B. 多叉树 
C. 哈希表 
D. C+树 
E. 二维表 

3. 在下列各项中, 只有( )不是计算机的存储容量常用单位 
A. Byte 
B. KB 
C. MB 
D. UB 
E. TB 

4. ASCII码的含义是 ( ) 
A. 二—十进制转换码 
B. 美国信息交换标准代码 
C. 数字的二进制数码 
D. 计算机可处理字符的唯一编码 
E. 常用字符的二进制编码 

5. 在Pascal语言中, 表达式(23 or 2 xor 5)的值是( ) 
A. 18 
B. 1 
C. 23 
D. 32 
E. 24 

6. 在Pascal语言中, 判断整数a等于0或b等于0或c等于0的正确的条件表达式是( ) 
A. not ((a&lt;&gt;0) or (b&lt;&gt;0) or (c&lt;&gt;0)) 
B. not ((a&lt;&gt;0) and (b&lt;&gt;0) and (c&lt;&gt;0)) 
C. not ((a=0) and (b=0) and (c=0)) 
D. (a=0) and (b=0) and (c=0) 
E. not ((a=0) or (b=0) or (c=0)) 

7. 地面上有标号为A、B、C的3根细柱, 在A柱上方有10个直径相同中间有孔的圆盘, 从上到下次编号为1, 2, 3, ……，将A柱上的部分盘子经过B柱移入C柱, 也可以在B柱上暂存。如果B柱上的操作记录为：“进，进，出，进，进，出，出，进，进，出，进，出，出”。那么, 在C柱上, 从下到上的盘子的编号为( ). 
A. 2 4 3 6 5 7 
B. 2 4 1 2 5 7 
C. 2 4 3 1 7 6 
D. 2 4 3 6 7 5 
E. 2 1 4 3 7 5 

8. 与十进制数17.5625相对应的8进制数是( ) 
A. 21.5625 
B. 21.44 
C. 21.73 
D. 21.731 
E. 前4个答案都不对 

9. ……在以下各个描述中, 不一定是欧拉图的是: 
A. 图G中没有度为奇数的顶点 
B. 包括欧拉环游的图(欧拉环游是指通过图中每边恰好一次的闭路径) 
C. 包括欧拉闭迹的图(欧拉迹是指通过途中每边恰好一次的路径) 
D. 本身为闭迹图 
E. 存在一条回路, 通过每个顶点恰好一次 

10. ……, 关于死循环的说法中, 只有( )是正确的. 
A. 不存在一种算法, 对任何一个程序及相应输入数据, 都可以判断是否会出现死循环, 因而, 任何编译系统都不作死循环检查. 
B. 有些编译系统可以检测出死循环. 
C. 死循环属于语法错误, 既然编译系统能检查各种语法错误, 当然也可以检查出死循环. 
D. 死循环与多进程中出现的&quot;死锁&quot;差不多, 而死锁是可以检查的, 因而, 死循环也是可以检测的 
E. 对于死循环, 只能等待发生时作现场处理, 没有什么更积极的手段. 

不定项选择: 
11. 设A=B=true, C=D=false, 以下逻辑表达是值为真的是( ) 
......那3个符号不会打 

12. 命题“P-&gt;Q”可读做P蕴含Q, 其中P、Q是两个独立的命题. 只有命题P成立而命题Q不成立时, 命题&quot;P-&gt;Q&quot;的值为False, 其它情况均为true. 与命题&quot;P-&gt;Q&quot;等角的逻辑关系式是( ) 
还是不会打那几个符号 

13. (2070)16+(34)8的结果是 
A. (8332)10 
B. (208C)16 
C. (100000000110)2 
D. (20214)8 

14. 已知7个节点的二叉树的先根遍历是1 2 4 5 6 3 7(……), 后根遍历是4 6 5 2 7 3 1, 则该二叉树的可能的中根遍历是( ) 
A. 4 2 6 5 1 7 3 
B. 4 2 5 6 1 3 7 
C. 4 2 3 1 5 4 7 
D. 4 2 5 6 1 7 3 

15. ……下面关于冗余数据的说法中, 正确的是( ) 
A. 应该在数据库中清除一切冗余数据. 
B. 与高级语言编写的数据处理系统相比, 用关系数据库编写的系统更容易消除冗余数据. 
C. 为高查询效率, 在数据库中可以适当保留一些冗余数据, 但更新时要做相容性检查. 
D. 作相容性检查会降低效率, 可以不理睬数据库中的冗余数据. 

16. 下列各软件中, 属于NOIP竞赛(复赛)推荐使用的语言环境有( ) 
A. gcc 
B. g++ 
C. Turbo C 
D. free pascal 

17. 以下断电后仍能保存数据的有( ) 
A. 硬盘 
B. ROM 
C. 显存 
D. RAM 

18. 在下列关于计算机语言的说法中, 正确的有( ) 
A. 高级语言比汇编语言更高级, 是因为他的程序的运行效率更高. 
B. 随着Pascal、C等高级语言的出现, 机器语言和汇编语言已经退出了历史舞台. 
C. 高级语言程序比汇编语言程序更容易从一种计算机移植到另一种计算机上. 
D. C是一种面向过程的高级计算机语言. 

19. 在下列关于算法复杂度的说法中, 正确的有( ) 
A. 算法的时间复杂度, 是指它在某台计算机上具体实现时的运行时间. 
B. 算法的时间复杂度, 是指对于该算法的一种或几种主要的运算, 运算的次数与问题的规模之间的函数关系. 
C. 一个问题如果是NPC类的, 就意味着在解决该问题时, 不存在一个具有多项式时间复杂度的算法. 但这一点还没有得到理论上证实, 也没有被否定. 
D. 一个问题如果是NP类, 与C有相同的结论.. 

20. 近20年来, 许多计算机专家都大力推崇递归算法, 认为它是解决较复杂问题的强有力的工具. 在下列关于递归的说法中, 正确的是( ) 
A. 在1977年前后形成标准的计算机高级语言&quot;FORTRAN77&quot;禁止在程序使用递归, 原因之一是该方法可能会占用更多的内存空间. 
B. 和非递归算法相比, 解决同一个问题, 递归算法一般运行得更快一些. 
C. 对于较复杂的问题, 用递归方式编程往往比非递归方式更容易一些. 
D. 对于已定义好的标准数学函数sin(x), 应用程序中的语句&quot;y=sin(sin(x));&quot;就是一种递归调用. 

五，完善程序 
1.格雷码 Gray Code 
Gray Code是一种二进制编码……特点是，对于两个相邻的十进制数，对应的两个GrayCode只有一个二进制位不同。最大和最小的两个数也叫相邻。3位的(原题是4位的)例子如下： 
0 000 
1 001 
2 011 
3 010 
4 110 
5 111 
6 101 
7 010 
由于……，GrayCode应用于……领域。 
下面的程序：输入n(&lt;16),m(0&lt;=m&lt;2^n)(都是十进制),输出对应于m的n位格雷码(用gr[]存放) 

program s501; 
var bound,m,n,i,j,b,p:integer; 
gr:array[0..14]of integer; 
begin 
bound:=1; 
writeln(&#39;input n,m&#39;); 
readln(n,m); 
for i:=1 to n do bound:=[___1___]; 
if (m&lt;0)or(m&gt;=bound) then 
begin 
writeln(&#39;Data error!&#39;); 
[___2___]; 
end; 
b:=1; 
for i:=1 to n do 
begin 
p:=0; b:=b*2; 
for [___3___] to m do 
if ( [___4___] ) then 
p:=1-p; 
gr<i>:=p; 
end; 
for i:=n [___5___] do 
write(gr<i>); 
writeln; 
end. 

2. 连续邮资 
n 种邮票面值，最多贴m张。如何设计面值，使得能够贴出尽量大的maxv,使得{1,2,3,...,maxv}的都能贴出来。例如，n=5,m=4 则答案为{1,3,11,15,32}，可以maxv=70，就是1..70都能贴出来。 
下面是这个程序，x[1..n]表示n中面值，且严格递增。bestx[1..n]存放最优解的x[1..n]。y[1..maxl]记录当前的x[1..i]能够贴出来的各种邮资所需最少张数。]]></description>
 <link><![CDATA[https://bbs.oifans.cn/job.php?action=topost&tid=1535&pid=12649]]></link>
 <author><![CDATA[webmaster@oifans.cn (兔子star)]]></author>
 <category><![CDATA[NOIP2011]]></category>
 <pubDate><![CDATA[Sun, 21 Oct 2007 04:11:52 +0000]]></pubDate>
</item>
</channel></rss>