讨论 / 那尼?90?求解
wsxtyrdd 2012-04-12 07:51:00
点我顶贴 收藏 删除
查看状态 Show Status

题目:Loser’s Spring

状态: Unaccepted

测评机: Xeond[6]

得分: 90分

提交日期: 2012-4-11 13:47:00

有效耗时: 2375毫秒

RQNOJ近期在线比赛列表

RQNOJ2012五月省选特别赛 时间:2012-X-X 13:00:00 [报名]

测试结果1: 通过本测试点|有效耗时172ms

测试结果2: 通过本测试点|有效耗时281ms

测试结果3: 通过本测试点|有效耗时266ms

测试结果4: 通过本测试点|有效耗时265ms

测试结果5: 通过本测试点|有效耗时281ms

测试结果6: 通过本测试点|有效耗时266ms

测试结果7: 通过本测试点|有效耗时265ms

测试结果8: 通过本测试点|有效耗时266ms

测试结果9: 通过本测试点|有效耗时313ms

测试结果10: 运行错误|普通保护错误

提交代码: view sourceprint?01.var x,y,c,z,i,j,t,a,n,b:longint;

02.

f:array[0..5000,0..5000]of longint;

03.

m,m1:array[0..9]of string;

04.

w,v,s:array[0..10000]of longint;

05.function max(a,b:longint):longint;

06.begin

07.max:=a;

08.if b>a then max:=b;

09.end;

10.begin

11.read(a,n,b);

12.m[0]:='ling';m[1]:='yi';m[2]:='liang';m[3]:='san';m[4]:='si';

13.m[5]:='wu';m[6]:='liu';m[7]:='qi';m[8]:='ba';m[9]:='jiu';

14.for i:=0 to 9 do

15.m1[i]:=m[i];

16.m1[2]:='er';

17.for i:=1 to a do

18.for j:=1 to b do

19.f[a,b]:=-maxlongint;

20.for i:=1 to n do

21.read(w[i],v[i],s[i]);

22.for i:=1 to n do

23.for j:=a downto w[i] do

24.for t:=b downto s[i] do

25.f[j,t]:=max(f[j,t],f[j-w[i],t-s[i]]+v[i]);

26.x:=f[a,b] div 1000;

27.y:=f[a,b] div 100 mod 10;

28.c:=f[a,b] div 10 mod 10;

29.z:=f[a,b] mod 10;

30.if (x<>0) and (y=0) and (c=0) and (z=0) then begin write(m[x],' ','qian'); halt; end;

31.if (x=0) and (y=0) and (c<>0) and (z=0) then begin write(m[c],' ','shi'); halt; end;

32.if (x=0) and (y<>0) and (z=0) and (c=0) then begin write(m[y],' ','bai');halt; end;

33.if ((x<>0) and (y<>0)) then write(m[x],' ','qian ');

34.if (x<>0) and (y=0) and ((c<>0)or(z<>0)) then write(m[x],' ','qian ling ');

35.if (y<>0) and (c<>0) then write(m[y],' ','bai ');

36.if (y<>0) and (c=0) and (z<>0) then write(m[y],' ','bai ling ');

37.if (c<>0) and (z=0) then begin write(m[c],' ','shi');halt; end;

38.if c<>0 then write(m[c],' ','shi ');

39.if z<>0 then write(m1[z]);

40.end.

被恶心死.......

#1 wsxtyrdd@2012-04-10 22:56:00
回复 删除
奇葩了 我就点一下怎么出来3张贴子.....

快省赛了

RP++++++

#2 星光流年@2012-04-11 03:37:00
回复 删除
同求解.

不清楚- - 话说我和你写的差不多, 我最后一个数据是无聊加了句

k:=0;

for i:=1 to n do

if s[i]>b then k:=1;

if k=0 then .....

else write('ling');

过的- -;

好吧, 同求解,为毛lz的方程不对.

#3 wsxtyrdd@2012-04-12 07:51:00
回复 删除
if (x=0) and (y=0) and (c=0) and (z=0) then begin write('ling'); halt; end;

搞定了...

查看更多回复
提交回复