夢見在炮兵陣地上

  • 作者:由 匿名使用者 發表于 旅遊
  • 2022-09-20

夢見在炮兵陣地上sunshine2018.11.02 回答

你當過炮兵或正在服役吧,這個經歷深深刻在你內心深處!所以有時會夢裡回到陣地!說明你是一個忠於職守的人,喜歡這段經歷!

夢見在炮兵陣地上起床特困戶2017.02.09 回答

這是炮兵陣地的pascal程式。。。在pku上過了的! var n,m:integer; sts:array[1。。100] of integer; ps,c:array[0。。61] of integer; pn:integer; map:array[1。。100] of string[20]; dps:array[1。。100,0。。61,0。。61] of integer; procedure init; var i,j:integer; begin readln(n,m); for i:=1 to n do readln(map[i]); for i:=1 to n do begin sts[i]:=0; for j:=1 to m do if map[i][j]=‘h’ then sts[i]:=sts[i]+(1 shl (m-j)); end; pn:=0; end; procedure pdfs(curr,dep:integer); var cnt,i,j:integer; begin if dep=m then begin pn:=pn+1; ps[pn]:=curr; cnt:=0; for i:=1 to m do if (curr and (1 shl (i-1)))<>0 then cnt:=cnt+1; c[pn]:=cnt; exit; end; pdfs(curr,dep+1); if (dep>0)and((curr and (1 shl (dep-1)))<>0) then exit; if (dep>1)and((curr and (1 shl (dep-2)))<>0) then exit; pdfs(curr or (1 shl dep),dep+1); end; procedure dp; var i,j,k,l,ans:integer; begin pdfs(0,0); fillchar(dps,sizeof(dps),0); for j:=1 to pn do begin if (ps[j] and sts[1])<>0 then continue; for k:=1 to pn do dps[1][j][k]:=c[j]; end; for i:=2 to n do for j:=1 to pn do begin if (sts[i] and ps[j])<>0 then continue; for k:=1 to pn do begin if ((sts[i-1] and ps[k])<>0)or((ps[k] and ps[j])<>0) then continue; for l:=1 to pn do begin if (i>2)and((sts[i-2] and ps[l])<>0) then continue; if ((ps[l] and ps[k])<>0)or((ps[l] and ps[j])<>0) then continue; if dps[i-1][k][l]+c[j]>dps[i][j][k] then dps[i][j][k]:=dps[i-1][k][l]+c[j]; end; end; end; ans:=0; for i:=1 to pn do for j:=1 to pn do if ans

Top