NOIP2006~~
文章目录
### NOIP2006~~
#### [ziyunch](http://www.ycool.com/space.php?uid=1580293) 发表于 2006-10-21 19:35:31 @ MSN Live
单选错三题,最郁闷的是第八题明明算出来的,结果选的C,最搞笑的本来是那个南丁格尔奖,但后来第六题不用做白白送分把它踢了下来……
双选狂错五题。
14题二叉树已知先序后序不能唯一确定,我有大把的时间却不仔细看看,郁闷~~
15题虽知道那四个都是数据库软件,我怎么知道谁以关系型为主体,谁知道都是?……
16题……偶只晓得FP,虽喜欢C但毕竟不考……
18题19题恶~~
20题最搞笑了……“本题不回答为0分,答题一律满分”,其实每个人都想选B的~~
问题求解么第一题没做出来(又没法猜又没法凑我图论又没在编程课上学过……)
阅读程序写结果全是送分的啊送分的啊分的啊(回声……)
我做错第一题,又是没有利用空余时间的典范
附四题程序、输入、输出(自己OCR的,已验证)
Program ex401;
var
u,v:array[0..3]of integer;
i,x,y:integer;
begin
x:=10;y:=10;
for i:=0 to 3 do
read(u[i]);
v[0]:=(u[0]+u[1]+u[2]+u[3]) div 7;
v[1]:=u[0] div ((u[1]-u[2]) div u[3]);
v[2]:=u[0]*u[1] div u[2]*u[3];
v[3] :=v[0]*v[1];
x:=(v[0]+v[1]+2)-u[(v[3]+3) mod 4];
if(x>10)then
y:=y+(v[2]*100-v[3])div(u[u[0] mod 3]*5)
else
y:=y+20+(v[2]*100-v[3]) div (u[v[0] mod 3]*5);
writeln(x, ', ',y);
end.
9 3 9 4
-13,57
Program ex402;
const
m:array[0..4]of integer=(2,3,5,7,13);
var
i,j:integer;
t:longint;
begin
for i:=0 to 4 do
begin
t:=1;
for j:=1 to m[i]-1 do t:=t*2;
t:=(t*2-1)*t;
write (t,'');
end;
writeln;
readln;
end.
6 28 496 8128 33550336
Program ex403;
ConstNN=7;
Type
Arr1=array[0..30] of char;
var
s:arr1;
k,p: integer;
Function fun1(s:arr1; a:char;n:integer) :integer;
var
j:integer;
begin
j:=n;
while (a0) do dec(j);
fun1:=j;
end;
Function fun2(s:arr1; a:char; n:integer) :integer;
var
j: integer;
begin
j :=1;
while (a>s[j])and(j
fun2:=j;
end;
begin
for k:=1 to NN do
s[k]:=chr(ord('A')+2*k+1);
k:=fun1(s,'M',NN)+fun2(s,'M',NN);
writeln(k);
readln;
end.
11
program ex404;
var
x, x2: longint;
procedure digit(n,m:longint);
var n2:integer;
begin
if(m>0) then
begin
n2:=n mod 10;
write(n2:2);
if(m>1) thendigit(n div 10,m div 10);
n2:=n mod 10;
write (n2:2);
end;
end;
begin
writeln('Input a number:');
readln (x);
x2:=1;
while(x2
x2:=x2 div 10;
digit (x, x2);
writeln;
end.
9734526
62543799734526
完善程序也是送分的啊难道不是吗??可是我还是丢了八分。第一空错的是莫名其妙OTL。9,10空是……还是粗心啊没想到KZ要是-1的……郁闷这八分……
同样附程序(自己OCR的,已验证)
Program ex501;
Var
i,n,k:integer;
a:array[1..10] of integer;
count:longint;
Procedureperm2(j:integer);
var i,p,t:integer;
begin
if j=k then
begin
For i:=k to n do
begin
inc(count);
t:=a[k]; a[k]:=a[i]; a[i]:=t;
for p:=1 to k do write(a[p] :1);
write('');
t:=a[k];a[k]:=a[i];a[i]:=t;
if (count mod 5=0) then writeln;
end;
exit;
end;
For i:=j to n do
begin
t:=a[j];a[j]:=a[i];a[i]:=t;
perm2(j+1);
t:=a[j];a[j]:=a[i];a[i]:=t;
end
end;
begin
writeln('Entry n,k (k<=n):');read(n,k);
count:=0;
for i:=1 to n do a[i]:=i;
perm2(1);
end.
program ex502;
type arr1=array[0..20] of integer;
var
a1,a2,kz1,kz2:arr1;
n,k,t1,t2:integer;
functionrand1(k:integer):integer;
var t:integer;
begin
t:=0;
while (t<2) or(t>k) do
t:=random(k+1)-2;
rand1:=t;
end;
procedure read1(var a:arr1;m:integer);
var
i:integer;
begin
for i:=1 to m do read(a[i]);
a[0]:=0;
end;
procedurewrt1(var a:arr1;m:integer);
var
i:integer;
begin
for i:=1 to m do write(a[i]:3);
end;
procedure cross(var a1,a2:arr1;t1,t2,n:integer);
var
i,j,t,kj:integer;
begin
for i:=t1 to t2 do
begin
t:=a1[i];a1[i]:=a2[i];a2[i]:=t;
end;
for i:=1 to n do
if (it2) then
begin
kz1[i]:=-1;kz2[i]:=-1;
end
else
begin
kz1[i]:=1;kz2[i]:=1;
end;
for i:=t1 to t2 do
for j:=t1 to t2 do
if(a1[i]=a2[j]) then
begin
kz1[i]:=0;kz2[j]:=0;break; end;
for i:=t1 to t2 do
if(kz1[i]=1) then
begin
for j:=t1 to t2 do
if (kz2[j]=1) then
begin kj:=j; break; end;
for j:=1 to n do
if (a1[j]=a1[i]) and (kz1[j]=-1) then
begin a1[j]:=a2[kj];break; end;
for j:=1 to n do
if (a2[j]=a2[kj]) and (kz2[j]=-1) then
begin a2[j]:=a1[i]; break; end;
kz1[i]:=0;kz2[kj]:=0;
end;
end;
begin
writeln('input (n>5) :');
readln(n);
writeln('input array 1:');read1(a1,n);
writeln('input array 2:');read1(a2,n);
t1:=rand1(n-1);
repeat
t2:=rand1(n-1);
until (t1<>t2);
if (t1>t2) then
begin k:=t1;t1:=t2;t2:=k;end;
cross(a1,a2,t1,t2,n);
wrt1(a1,n);wrt1(a2,n);
end.
总结一下发现临时抱抱佛脚还是有用的,虽然不懂的树和图的概念还是不懂但不影响太多,况且第八题我做出来的呀(不还是写错了吗)。
唉唉,希望分数线比我低啊~~(妄想!!)
文章作者 ziyunch
上次更新 2006-10-21