Compare commits
6 Commits
c2def12c80
...
0db4fdd6b0
Author | SHA1 | Date | |
---|---|---|---|
|
0db4fdd6b0 | ||
|
c168d4f6e0 | ||
|
444d4bded9 | ||
|
3e26bbdbda | ||
|
703920e2fd | ||
|
d6de4c2aa4 |
@ -7,6 +7,7 @@ const double inf=1e100,EPS=1e-6;
|
|||||||
const int W = 20;
|
const int W = 20;
|
||||||
double l, now;
|
double l, now;
|
||||||
int n;
|
int n;
|
||||||
|
//一道墙
|
||||||
struct wall
|
struct wall
|
||||||
{
|
{
|
||||||
double x, y[6], val[5];
|
double x, y[6], val[5];
|
||||||
@ -33,7 +34,8 @@ int sign(double d)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else return d>0? 1:-1;
|
else
|
||||||
|
return d > 0 ? 1 : -1;
|
||||||
}
|
}
|
||||||
bool ob(int li, int lj, int ri, int rj)
|
bool ob(int li, int lj, int ri, int rj)
|
||||||
{
|
{
|
||||||
@ -65,7 +67,8 @@ void find(int ii,int jj)
|
|||||||
w[ii].val[jj] = now;
|
w[ii].val[jj] = now;
|
||||||
}
|
}
|
||||||
// printf("(%.0lf,%.0lf)(%.0lf,%.0lf):length:%.3lf,now:%.3lf£¬val:%.3lf\n",w[ii].x,w[ii].y[jj],w[i].x,w[i].y[j],l,now,w[ii].val[jj]);
|
// printf("(%.0lf,%.0lf)(%.0lf,%.0lf):length:%.3lf,now:%.3lf£¬val:%.3lf\n",w[ii].x,w[ii].y[jj],w[i].x,w[i].y[j],l,now,w[ii].val[jj]);
|
||||||
if(i==0) break;
|
if (i == 0)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,7 +79,8 @@ void doit()
|
|||||||
for (int j = 1; j <= 4; j++)
|
for (int j = 1; j <= 4; j++)
|
||||||
{
|
{
|
||||||
find(i, j);
|
find(i, j);
|
||||||
if(i==n) break;
|
if (i == n)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,7 +89,8 @@ int main()
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
scanf("%d", &n);
|
scanf("%d", &n);
|
||||||
if(n==-1) return 0;
|
if (n == -1)// 结束
|
||||||
|
return 0;
|
||||||
memset(&w, 0, sizeof(wall) * (n + 1));
|
memset(&w, 0, sizeof(wall) * (n + 1));
|
||||||
w[0].x = 0;
|
w[0].x = 0;
|
||||||
w[0].y[1] = 5;
|
w[0].y[1] = 5;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user