主题:求解
老劈手2号
[专家分:160] 发布于 2011-03-31 11:35:00
邮局发行一套票面有四种不同值的邮票,如果每封信所贴邮票张数不超过三枚,存在整数r,使得用不超三枚的邮票,可以贴出连续的整数1、2、3、……、r来,找出这四种面值数,使得r最大。
请求高手快速回复
感激不尽!!!!!!!!!!
(回复时希望说出思路)
回复列表 (共3个回复)
沙发
emmaa [专家分:0] 发布于 2011-04-29 17:05:00
Our [URL=http://www.coachoutletstoreus.net/coach-handbags]Coach Handbags Outlet[/url] are the best choice for those who want to go out for shopping or do something outdoors. There are quite a few features that are unique with [URL=http://www.coachoutletstoreus.net/coach-backpack]Coach Backpack[/url] on [URL=http://www.coachoutletstoreus.net/]Coach Outlet Store[/url]. One of these [URL=http://www.coachoutletstoreus.net/coach-sunglasses]Coach Sunglasses[/url] is the fact that you can get a Mini Signature on your own [URL=http://www.coachoutletstoreus.net/coach-briefcase]Coach Briefcase[/url]. Our Cheap Coach Sling Bags with fashion style, delicate outlooking, top quality and the cheapest price. The Coach Bags are very convenient for people to take with now on [URL=http://www.coachoutletstoreus.net/]Coach Outlet Online[/url]. So many people take [URL=http://www.coachoutletstoreus.net/coach-tote-bags]Coach Tote Bags[/url] as the best choice. Buy now from our Coach Store Online.
板凳
cgl_lgs [专家分:21040] 发布于 2011-05-10 17:11:00
N进制问题,自己想想先。
3 楼
幽灵密码 [专家分:3510] 发布于 2011-05-26 18:01:00
uses crt;
var a,b,c,d:integer;
x,x0,x1,x2,x3,x4:integer;
st:set of 1..100;
function num(a,b,c,d:integer):integer;
var y1,y2,y3,y4,s:integer;
begin
st:=[];
for y1:=0 to 3 do
for y2:=0 to 3-y1 do
for y3:=0 to 3-(y1+y2) do
for y4:=0 to 3-(y1+y2+y3) do
if y1+y2+y3+y4<=3 then begin
s:=y1*a+y2*b+y3*c+y4*d;
st:=st+[s]
end;
s:=1;
while s in st do inc(s);
num:=s-1
end;
begin
clrscr;
a:=1;
x0:=0;
for b:=a+1 to 3*a+1 do
for c:=b+1 to 3*b+1 do
for d:=c+1 to 3*c+1 do begin
x:=num(a,b,c,d);
if x>x0 then begin x0:=x;x1:=a;x2:=b;x3:=c;x4:=d end
end;
writeln(x1,' ',x2,' ',x3,' ',x4);
readln
end.
我来回复