请求某位神犇做做这题看数据错否

P1269 信号放大器

没人?@kkksc03
by Great瞿葩 @ 2015-10-04 17:21:29


能不能给代码, 我看看我能不能造个反例
by kczno1 @ 2015-10-11 09:05:42


@[url=/space/show?uid=5763]Great瞿葩[/url] 虽然我也没a
by kczno1 @ 2015-10-11 09:06:33


@[url=/space/show?uid=9168]kczno1[/url] 今天晚上给,代码不在家里在学校...下午初赛加油哦。
by Great瞿葩 @ 2015-10-11 11:05:58


@[url=/space/show?uid=5763]Great瞿葩[/url] 我初赛失误了问题求解第一题写错了,链表那题也错了。估85.5 你估多少
by kczno1 @ 2015-10-12 18:00:14


@[url=/space/show?uid=9168]kczno1[/url] 我们湖南省初赛不用估分/擦汗 大概六十多或者七十多 然后呢我们湖南省的线一般是二三十分......所以老师从没上过初赛的课......和你们比不得...
by Great瞿葩 @ 2015-10-12 19:04:24


```cpp @[url=/space/show?uid=9168]kczno1[/url] program booster; var n,i,j,k,y,z,tot,ans,t:longint; f,list,d:array[0..100001] of longint; le:array[0..100001] of boolean; toit,cost,next:array[0..200001] of longint; procedure getin(x,y,z:longint); begin inc(tot); toit[tot]:=y; cost[tot]:=z; next[tot]:=list[x]; list[x]:=tot; end; procedure outit; begin writeln('No solution.'); close(output); close(input); halt; end; procedure dfs(x:longint); var t,te,v,num,i:longint; begin le[x]:=false; t:=list[x]; if d[x]<2 then begin f[x]:=1; exit; end; while t<>0 do begin if le[toit[t]] then begin dfs(toit[t]); if f[toit[t]]+cost[t]>k then begin inc(ans); if cost[t]+1>f[x] then f[x]:=cost[t]+1; end else if f[toit[t]]+cost[t]>f[x] then f[x]:=f[toit[t]]+cost[t]; end; t:=next[t]; end; end; begin assign(input,'booster.in'); reset(input); assign(output,'booster.out'); rewrite(output); readln(n); for i:=1 to n do begin read(d[i]); for j:=1 to d[i] do begin read(y,z); getin(i,y,z); getin(y,i,z); end; readln; end; readln(k); for i:=1 to n do begin t:=list[i]; if t=0 then outit; while t<>0 do begin if cost[t]>=k then outit; t:=next[t]; end; end; fillchar(f,sizeof(f),$80); fillchar(le,sizeof(le),true); dfs(1); writeln(ans); close(output); close(input); end. ```
by 瞿葩 @ 2015-10-12 19:05:50


@[url=/space/show?uid=5744]瞿葩[/url] 6 1 2 1 3 1 1 4 2 5 2 1 4 1 2 2 2 3 1 2 2 2 6 1 1 5 1 4
by kczno1 @ 2015-10-14 19:49:41


@[url=/space/show?uid=5744]瞿葩[/url] ans=1
by kczno1 @ 2015-10-14 19:53:58


@[url=/space/show?uid=5763]Great瞿葩[/url]
by kczno1 @ 2015-10-21 20:01:18


|