Time of Update: 2018-03-16
, $ B, $ d );Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ x + $ ox, $ y + $ oy, $ clr );$ X0 = $ x;$ Y0 = $ y;}}Function draw_sector ($ img, $ ox, $ oy, $ a, $ B, $ sd, $ ed, $ clr) // draw a fan{$ N = ceil ($ ed-$ sd)/ANGLE_STEP );$ D = $ sd;List ($ x0, $ y0) = draw_getexy ($ a, $ B, $ d );Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ ox, $ oy, $ clr );For ($ I = 0; $ I {$ D = ($ d + ANGLE_STEP)> $ ed? $ Ed :( $ d + ANGLE_STEP );List ($ x, $ y) = draw_getexy ($ a, $ B, $ d );Imageline ($ img,
Time of Update: 2017-05-13
+ $ ox, $ y + $ oy, $ clr );$ X0 = $ x;$ Y0 = $ y;}Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ ox, $ oy, $ clr );List ($ x, $ y) = chx_getexy ($ a/2, $ B/2, ($ d + $ sd)/2 );Imagefill ($ img, $ x + $ ox, $ y + $ oy, $ clr );}
Function chx_sector3d ($ img, $ ox, $ oy, $ a, $ B, $ v, $ sd, $ ed, $ clr) {// 3d fan surfaceChx_sector ($ img, $ ox, $ oy, $ a, $ B, $ sd, $ ed, $ clr );If ($ sd List ($ R, $ G, $ B) = chx_getdarkcolor ($ img, $ clr );$ Clr = imagecolorallocate ($ img, $ R, $ G, $ B );
Time of Update: 2016-07-29
, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
for ($i =0; $i {
$d = ($d +angle_step) > $ed $ed:($d +angle_step);
List ($x, $y) = Draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $x + $ox, $y + $oy, $CLR);
$x 0 = $x;
$y 0 = $y;
}
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
List ($x, $y) = Draw_getexy ($a/2, $b/2, ($d + $sd)/2);
Imagefill ($img, $x + $ox, $y + $oy, $CLR);
}
function Draw_sector3d ($img, $ox, $oy, $a, $b, $v, $SD, $ed, $clr)//3d fan
Time of Update: 2016-07-25
);
$d = $SD;
List ($x 0, $y 0) = draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
for ($i =0; $i
{
$d = ($d +angle_step) > $ed $ed:($d +angle_step);
List ($x, $y) = Draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $x + $ox, $y + $oy, $CLR);
$x 0 = $x;
$y 0 = $y;
}
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
List ($x, $y) = Draw_getexy ($a/2, $b/2, ($d + $sd)/2);
Ima
Time of Update: 2013-04-22
, $ x0 + $ ox, $ y0 + $ oy, $ ox, $ oy, $ clr );For ($ I = 0; $ I $ D = ($ d + ANGLE_STEP)> $ ed? $ Ed :( $ d + ANGLE_STEP );List ($ x, $ y) = chx_getexy ($ a, $ B, $ d );Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ x + $ ox, $ y + $ oy, $ clr );$ X0 = $ x;$ Y0 = $ y;}Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ ox, $ oy, $ clr );List ($ x, $ y) = chx_getexy ($ a/2, $ B/2, ($ d + $ sd)/2 );Imagefill ($ img, $ x + $ ox, $ y + $ oy, $ clr );}
Function chx_sector3d ($ img, $ ox, $ oy, $ a, $ B, $
Time of Update: 2017-05-13
);
Imagefill ($ img, $ x + $ ox, $ y + $ oy, $ clr );
}
Function chx_sector3d ($ img, $ ox, $ oy, $ a, $ B, $ v, $ sd, $ ed, $ clr) {// 3d fan surface
Chx_sector ($ img, $ ox, $ oy, $ a, $ B, $ sd, $ ed, $ clr );
If ($ sd List ($ R, $ G, $ B) = chx_getdarkcolor ($ img, $ clr );
$ Clr = imagecolorallocate ($ img, $ R, $ G, $ B );
If ($ ed> 180) $ ed = 180;
List ($ sx , $ sy) = chx_getexy ($ a, $ B, $ sd );
$ Sx
Time of Update: 2016-01-25
,ny,i,ter); Mp[nx][ny]=0; } Else{DFS (nx,ny,i,ter+1); Mp[nx][ny]=0; } } if(nx==exny==ey) { if(dire==i) {if(ter2) flag=true; return; } Else { if(ter2) flag=true; return; } } } return;}intMain () {#ifdef LOCAL freopen ("In.txt","R", stdin);#endif //LOCAL //StartIos::sync_with_stdio (false); while(cin>>n>>m (n| |m) {memset (MP,0,sizeofMP); for(intI=1; i) for(intj=1; j) Cin>>Mp[i][j]; intN; CIN>>o;
Time of Update: 2015-08-28
Code One:#include #include#includeusing namespacestd;Const intmax_n=205;Const intinf=0x30303030;CharMap[max_n][max_n];intn,m;intSx,sy;intGx,gy;intdx[4]={1,0, -1,0};intdy[4]={0,1,0, -1};typedef pairint,int>P;intDist[max_n][max_n];intBFsintYintx) { for(intI=0; i) for(intj=0; j) Dist[i][j]=INF; DIST[SY][SX ]=0; Queueque; Que.push (P (SY,SX )); while(!Que.empty ()) {P pos=Que.front (); Que.pop
Time of Update: 2015-08-02
; + Point Next,now; -now.x=sx ;now.y=Sy; +now.step=0; Anow.dir=-1; at Q.push (now); - while(!q.empty ()) - { -now=Q.front (); - Q.pop (); - if(now.x==exnow.y==ey) in return 1; - for(i=0;i4; i++) to { +next.x=now.x+Dx[i]; -next.y=now.y+Dy[i]; thenext.step=Now.step; *Next.dir=i; $ if(next.dir!=now.dirnow.dir!=-1)//change the direction to add one, but the first step is not a turning pointPanax Notog
Time of Update: 2017-05-14
{
Draw_sector ($ img, $ ox, $ oy, $ a, $ B, $ sd, $ ed, $ clr );
If ($ sd {
List ($ R, $ G, $ B) = draw_getdarkcolor ($ img, $ clr );
$ Clr = imagecolorallocate ($ img, $ R, $ G, $ B );
If ($ ed> 180) $ ed = 180;
List ($ sx , $ sy) = draw_getexy ($ a, $ B, $ sd );
$ Sx + = $ ox;
$ Sy + = $ oy;
List ($ ex, $ ey) = draw_getexy ($ a, $ B, $ ed );
$ Ex + = $ ox;
$ Ey + = $ oy;
Imageline ($ img, $
Time of Update: 2016-07-21
);
$x 0= $x;
$y 0= $y;
}
}
function Chx_sector ($img, $ox, $oy, $a, $b, $SD, $ed, $CLR) {//Draw slices
$n =ceil (($ed-$SD)/angle_step);
$d = $SD;
List ($x 0, $y 0) =chx_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
for ($i =0; $i $d = ($d +angle_step) > $ed $ed:($d +angle_step);
List ($x, $y) =chx_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $x + $ox, $y + $oy, $CLR);
$x 0= $x;
$y 0= $y;
}
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
List
Time of Update: 2013-12-01
($ img, $ ox, $ oy, $ a, $ B, $ v, $ sd, $ ed, $ clr) {// 3d fan surfaceChx_sector ($ img, $ ox, $ oy, $ a, $ B, $ sd, $ ed, $ clr );If ($ sd List ($ R, $ G, $ B) = chx_getdarkcolor ($ img, $ clr );$ Clr = imagecolorallocate ($ img, $ R, $ G, $ B );If ($ ed> 180) $ ed = 180;List ($ sx , $ sy) = chx_getexy ($ a, $ B, $ sd );$ Sx + = $ ox;$ Sy + = $ oy;List ($ ex, $ ey) = chx_getexy ($ a, $ B, $ ed );$ Ex + =
Time of Update: 2013-12-08
]. val [I] {+ + T [d]. num [I]; // here is the statistics on the number of elements from l to I entering the left child. This is the data mainly used by the tree.T [d + 1]. val [+ zn] = t [d]. val [I];} Else if (t [d]. val [I]> midd) // enter the right child{T [d + 1]. val [++ yn] = t [d]. val [I];} Else{If (samed {++ Samed;++ T [d]. num [I];T [d + 1]. val [+ zn] = t [d]. val [I];} Else // you have children.T [d + 1]. val [++ yn] = t [d]. val [I];}}Build (l, mid, d + 1); // create left and right
Time of Update: 2013-10-16
) = drawDarkColor ($ img, $ clr );// Assign color to the image$ Clr = imagecolorallocate ($ img, $ red, $ green, $ blue );If ($ ed> 180)$ Ed = 180;List ($ sx , $ sy) = getExy ($ a, $ B, $ sd );$ Sx + = $ ox;$ Sy + = $ oy;List ($ ex, $ ey) = getExy ($ a, $ B, $ ed );$ Ex + = $ ox;$ Ey + = $ oy;Imageline ($ img, $ sx , $ sy, $ sx
Time of Update: 2013-11-17
= 180;List ($ sx , $ sy) = draw_getexy ($ a, $ B, $ sd );$ Sx + = $ ox;$ Sy + = $ oy;List ($ ex, $ ey) = draw_getexy ($ a, $ B, $ ed );$ Ex + = $ ox;$ Ey + = $ oy;Imageline ($ img, $ sx , $ sy, $ sx , $ sy + $ v, $ clr );Imageline ($ img, $ ex, $ ey, $ ex, $ ey + $ v, $ clr );Draw_arc ($ img, $ ox, $ oy + $ v, $ a, $ B,
Time of Update: 2017-01-13
;} } Function draw_sector ($ img, $ ox, $ oy, $ a, $ B, $ sd, $ ed, $ clr) // draw a fan{ $ N = ceil ($ ed-$ sd)/ANGLE_STEP );$ D = $ sd;List ($ x0, $ y0) = draw_getexy ($ a, $ B, $ d );Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ ox, $ oy, $ clr );For ($ I = 0; $ I { $ D = ($ d + ANGLE_STEP)> $ ed? $ Ed :( $ d + ANGLE_STEP );List ($ x, $ y) = draw_getexy ($ a, $ B, $ d );Imageline ($ img, $ x0 + $ ox, $ y0 + $ oy, $ x + $ ox, $ y + $ oy, $ clr );$ X0 = $ x;$ Y0 = $ y;} Imageline ($ img, $ x0 +
Time of Update: 2016-06-13
, $ed, $CLR)//Draw slices
{
$n = Ceil (($ed-$SD)/angle_step);
$d = $SD;
List ($x 0, $y 0) = draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
for ($i =0; $i {
$d = ($d +angle_step) > $ed $ed:($d +angle_step);
List ($x, $y) = Draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $x + $ox, $y + $oy, $CLR);
$x 0 = $x;
$y 0 = $y;
}
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
List ($x, $y) = Draw_getexy ($a/2, $b/2, ($d + $sd)/2);
Imagefill ($img
Time of Update: 2017-01-19
, $ox, $oy, $a, $b, $SD, $ed, $CLR)//painting slices
{
$n = Ceil (($ed-$SD)/angle_step);
$d = $SD;
List ($x 0, $y 0) = draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
for ($i =0; $i {
$d = ($d +angle_step) > $ed $ed:($d +angle_step);
List ($x, $y) = Draw_getexy ($a, $b, $d);
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $x + $ox, $y + $oy, $CLR);
$x 0 = $x;
$y 0 = $y;
}
Imageline ($img, $x 0+ $ox, $y 0+ $oy, $ox, $oy, $CLR);
List ($x, $y) = Draw_getexy ($
Time of Update: 2018-07-25
pockets.Sample Input
1 1Sample Output
0Source mid-central USA 1997 Simple test Instructions: a m*n map, where the lattice is either *, or @, for @, diagonally to become a block, now requires writing a program to find out how many @ blocks in total. The process of solving ideas:
This is the most classic deep search topic. The teacher also spoke in class, so the idea naturally has. The DFS function is written out and it's all over. Impression: The example in class is also the most classic part. F
Time of Update: 2017-02-28
)//3d slices{Draw_sector ($img, $ox, $oy, $a, $b, $SD, $ed, $CLR);if ($SD {List ($R, $G, $B) = Draw_getdarkcolor ($img, $CLR);$CLR =imagecolorallocate ($img, $R, $G, $B);if ($ed >180) $ed = 180;List ($SX , $sy) = Draw_getexy ($a, $b, $SD);$SX + + $ox;$sy + + $oy;List ($ex, $ey) = Draw_getexy ($a, $b, $ed);$ex + + $ox;$ey + + $oy;Imageline ($img, $SX , $sy, $