讨论 / 这题用pascal能过吗?
594250 2012-08-20 04:13:00
点我顶贴 收藏 删除
rt
#1 Mamba24@2012-01-13 06:30:00
回复 删除
No

貌似过不去,但是浙江的数据用cena全过了 这上面WA3次 不行 - =

#2 594250@2012-01-14 05:45:00
回复 删除
此帖作废

orz renqing

#3 itsvzc@2012-01-14 23:59:00
回复 删除
可以全过

- = 这个问题是显然的...

#4 dyf666@2012-02-03 06:06:00
回复 删除
这个。。。。

c++的路过。。能不能a关是不是p有什么关系

#5 zhs490770@2012-08-19 02:51:00
回复 删除
。。

菜鸟曰:同样的算法,在rq上p明显比c慢

#6 fts96@2012-08-20 04:13:00
回复 删除
以下代码经测试已AC……

01.program qc;

02.const MAXSIZE=200000;

03.var

04.w,v,l,r,sum:array[0..MAXSIZE] of longint;

05.sumv:array[0..MAXSIZE] of int64;

06.s,value,minvalue:int64;

07.i:longint;

08.m,n:longint;

09.max,min,k,kk:longint;

10.procedure getsum(x:longint);

11.var i:longint;

12.begin

13.sum[0]:=0;

14.sumv[0]:=0;

15.for i:=1 to n do

16.begin

17.

if w[i]>=x then begin sum[i]:=sum[i-1]+1; sumv[i]:=sumv[i-1]+v[i]; end

18.

else begin sum[i]:=sum[i-1]; sumv[i]:=sumv[i-1]; end;

19.end;

20.end;

21.begin

22.max:=0;

23.min:=maxlongint;

24.readln(n,m,s);

25.for i:=1 to n do

26.begin

27.

readln(w[i],v[i]);

28.

if w[i]>max then max:=w[i];

29.

if w[i]<min then min:=w[i];

30.end;

31.for i:=1 to m do readln(l[i],r[i]);

32.inc(max);

33.k:=(max+min) div 2;

34.repeat

35.getsum(k);

36.value:=0;

37.for i:=1 to m do

38.value:=value+(sumv[r[i]]-sumv[l[i]-1])*(sum[r[i]]-sum[l[i]-1]);

39.if (minvalue=0) or (minvalue>abs(value-s)) then minvalue:=abs(value-s);

40.if value<s then max:=k else min:=k;

41.kk:=k;

42.k:=(max+min) div 2;

43.until (k=kk) or (minvalue=0);

44.write(minvalue);

45.end.

个人信息 消息 注销 赞助我们 首页 题库 赛题 比赛 状态 排行 讨论 单题讨论 题解 团队 查看状态 Show Status

题目:[NOIP2011提高组]聪明的质监员

状态: Accepted

测评机: Xeond[6]

得分: 100分 [我要评价一下题目~]

提交日期: 2012-4-8 11:50:00

有效耗时: 5593毫秒

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

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

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

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

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

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

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

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

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

测试结果10: 通过本测试点|有效耗时187ms

测试结果11: 通过本测试点|有效耗时188ms

测试结果12: 通过本测试点|有效耗时188ms

测试结果13: 通过本测试点|有效耗时187ms

测试结果14: 通过本测试点|有效耗时203ms

测试结果15: 通过本测试点|有效耗时297ms

测试结果16: 通过本测试点|有效耗时344ms

测试结果17: 通过本测试点|有效耗时453ms

测试结果18: 通过本测试点|有效耗时609ms

测试结果19: 通过本测试点|有效耗时625ms

测试结果20: 通过本测试点|有效耗时781ms

查看更多回复
提交回复