永发信息网

谁有NOIP2010提高组的标程或满分程序贴个来!!

答案:1  悬赏:10  手机版
解决时间 2021-03-06 00:06
谁有NOIP2010提高组的标程或满分程序贴个来!!
最佳答案
program translate(input,output); const maxn=1000; var n,m,f,r,x,i,ans:longint; q,a:array[1..maxn] of longint; procedure push(x:longint); begin if a[x]=1 then exit; inc(r);q[r]:=x;a[x]:=1;inc(ans); if r-f+1>m then begin a[q[f]]:=0; inc(f); end; end; begin assign(input,'translate.in');reset(input); assign(output,'translate.out');rewrite(output); fillchar(a,sizeof(a),0); readln(m,n); ans:=0; for i:=1 to n do begin read(x); push(x); end; writeln(ans); close(input);close(output); end. program tortoise(input,output); const maxcount=40; maxn=350; var f:array[-1..maxcount,-1..maxcount,-1..maxcount,-1..maxcount] of longint; score:array[1..maxn] of longint; a:array[1..4] of longint; n,m,i,j,k,l,step,x:longint; begin assign(input,'tortoise.in');reset(input); assign(output,'tortoise.out');rewrite(output); readln(n,m); for i:=1 to n do read(score[i]); readln; fillchar(a,sizeof(a),0); for i:=1 to m do begin read(x); inc(a[x]); end; fillchar(f,sizeof(f),0); for i:=0 to a[1] do for j:=0 to a[2] do for k:=0 to a[3] do for l:=0 to a[4] do begin step:=i+j*2+k*3+l*4+1; if f[i,j,k,l]k do dec(j); if i<=j then begin tmp:=a[i];a[i]:=a[j];a[j]:=tmp; inc(i);dec(j); end; end; if inil do begin v:=p^.v;w:=p^.w; if w>weight then begin if (color[v]<>0)and(color[v]=color[u]) then exit(false) else if (color[v]=0) then begin color[v]:=color[u] mod 2+1; inc(r);q[r]:=v; end; end; p:=p^.next; end; end; end; exit(true); end; procedure main; var l,r,mid:longint; begin qsort(1,m); l:=1;r:=m; while l<=r do begin mid:=(l+r) shr 1; if bfs(a[mid]) then r:=mid-1 else l:=mid+1; end; if r<=0 then ans:=0 else ans:=a[l]; end; begin init; main; over; end. program flow(input,output); const maxn=500; dx:array[1..4] of longint=(0,0,1,-1); dy:array[1..4] of longint=(1,-1,0,0); var n,m,ans,i,j:longint; q:array[1..maxn*maxn*2,1..2] of longint; s,h:array[1..maxn,1..maxn] of longint; st,ed,dp:array[0..maxn] of longint; flag:boolean; procedure judge; var f,r,x,y,tx,ty,k,i:longint; begin fillchar(s,sizeof(s),0); for k:=1 to m do if s[1,k]=0 then begin f:=1;r:=0; inc(r);q[r,1]:=1;q[r,2]:=k;s[1,k]:=1; while f<=r do begin x:=q[f,1];y:=q[f,2];inc(f); for i:=1 to 4 do begin tx:=x+dx[i];ty:=y+dy[i]; if (tx>=1)and(tx<=n)and(ty>=1)and(ty<=m) then if (s[tx,ty]=0)and(h[tx,ty]=1)and(tx<=n)and(ty>=1)and(ty<=m) then if (s[tx,ty]=0)and(h[tx,ty]0 then begin st[k]:=i;break; end; for i:=m downto 1 do if s[n,i]<>0 then begin ed[k]:=i;break; end; end; fillchar(dp,sizeof(dp),0); dp[0]:=0; for i:=1 to m do begin min:=maxlongint; for j:=1 to m do if (st[j]<=i)and(ed[j]>=i) then if dp[st[j]-1]
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯