Subscribe: RSS | Comment          Snow: Toggle | Change Wind
Insert AdSense Ads Here
Home

Displaying Category '解题'

1

十二
 

type stype=set of 1..10;
var
n,r:integer;
st:string;
s:stype;
a:array[1..100] of char;
procedure print;
var
i:longint;
begin
for i:=1 to r-1 do
write(a[i]);
writeln(a[r]);
end;
procedure se(t,k:integer);
var i:integer;
begin
if k>r then begin print; exit; end;
for i:=t to n do
if i in s then begin
a[k]:=st[i];
s:=s-[i];
se(i,k+1);
s:=s+[i];
end;
end;
begin
readln(n,r);
readln(st);
s:=[1..n];
se(1,1);
end.

Tags:
merry christmas
0

1

十二
 

var
a:longint;
begin
assign(input,’cost.in’);
assign(output,’cost.out’);
reset(input);
rewrite(output);
read(a);
if a<50 then write(a*0.538:0:2) else if a<200 then write(50*0.538+(a-50)*0.568:0:2) else write(50*0.538+150*0.568+(a-200)*0.638:0:2);
close(input);
close(output);

Tags:
merry christmas
0

1

十二

2014庐阳区信息学竞赛第2题-group

Posted by 窦学文
Filed under 解题
 

var
a,i,j,f,t:longint;
b:array[1..1000000]of longint;
begin
assign(input,’group.in’);
assign(output,’group.out’);
reset(input);
rewrite(output);
read(a);
for i:=1 to a do
read(b[i]);
for i:=1 to a-1 do
for j:=1 to a-i do
if b[j]>b[j+1] then begin t:=b[j]; b[j]:=b[j+1]; b[j+1]:=t; end;
for i:=b[1] downto 1 do
begin
f:=0;
for j:=1 to a do
if b[j] mod i 0 then f:=1;
if f=0 then begin write(i); break; end;
end;
close(input);
close(output);
end.

Tags:
merry christmas
0

1

十二

2014庐阳区信息学竞赛第3题—magic

Posted by 窦学文
Filed under 解题
 

var
a:array[0..10000] of longint;
n,m,i,j,t,k,s,s1:longint;
begin
assign(input,’magic.in’);
assign(output,’magic.out’);
reset(input);
rewrite(output);
read(n,m);
for i:=1 to n do
read(a[i]);
for i:=1 to n-1 do
for j:=1 to n-i do
if a[j]>a[j+1] then begin t:=a[j]; a[j]:=a[j+1]; a[j+1]:=t; end;
for i:=1 to n do
begin
inc(s);
for j:=n downto 1 do
if a[j]<m+a[1] then begin a[j]:=0; end;
a[n+1]:=1;
while a[1]=0 do
begin
for j:=1 to n do a[j]:=a[j+1];
n:=n-1;
end;
if n<=0 then break;
end;
write(s);
close(input);
close(output);
end.

Tags:
merry christmas
0
In collaboration with Bingo Sites, Free Bingo and Foxy Bingo.
Designed by