集客

集客
<2026年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

  • 随笔 - 0
  • 文章 - 0
  • 评论 - 0
  • 引用 - 0

常用链接

留言簿

搜索

  •  

最新评论

re: Ubuntu12.04安装Xen4[未登录] 小强 2014-05-26 11:36
'internal error: libxenlight does not support network device type network'
#define right(type) ( (type)((type)0 - 1) > 0) 就可以了,这个表达式生成全1的位字段,有符号的话就是-1,无的话就是2^k - 1,能确保正确工作
代码有错,erase_help操作导致右儿子指针可能指向一个没有分配存储的地址
C题,这个代码能过吗?

#include<iostream>
using namespace std;
struct point
{
int x,y;
}s[1001],os[1001];
int mycompare(const void *ele1,const void *ele2)
{
point *p1,*p2;
p1=(point*)ele1;
p2=(point*)ele2;
if(p1->x==p2->x)
return (p1->y-p2->y);
return (p1->x-p2->x);
}//x up then y up
int xmult(point p1,point p2,point p0)
{
return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);
}
bool pd(point s,point a,point b,point c)
{
if(xmult(a,s,b)*xmult(c,s,b)>=0)
return 0;
if(xmult(a,s,c)*xmult(b,s,c)>=0)
return 0;
if(xmult(b,s,a)*xmult(c,s,a)>=0)
return 0;
return 1;
}
int main()
{
int i,j,m,n,k,sum;
int a,b,c;
while(scanf("%d",&k)!=EOF)
{
for(j=1;j<=k;j++)
{
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&s[i].x,&s[i].y);
os[i].x=s[i].x;os[i].y=s[i].y;
}
qsort(os,n,sizeof(point),mycompare);
//for(i=0;i<n;i++)
//cout<<os[i].x<<" "<<os[i].y<<endl;
scanf("%d",&m);
cout<<"Case "<<j<<":"<<endl;
while(m--)
{
cin>>a>>b>>c;
int maxx=s[a].x>s[b].x?s[a].x:s[b].x;
if(s[c].x>maxx) maxx=s[c].x;
int minx=s[a].x<s[b].x?s[a].x:s[b].x;
if(s[c].x<minx) minx=s[c].x;
int maxy=s[a].y>s[b].y?s[a].y:s[b].y;
if(s[c].y>maxy) maxy=s[c].y;
int miny=s[a].y<s[b].y?s[a].y:s[b].y;
sum=0;
for(i=0;i<n;i++)
{
if(os[i].x<minx) continue;
if(os[i].x>maxx) break;
if(os[i].y<miny||os[i].y>maxy) continue;
if(pd(s[i],s[a],s[b],s[c]))
sum++;
}
cout<<sum<<endl;
}
}
}
}

re: POJ 1273 最大流[未登录] 小强 2009-09-30 16:54
请问楼主71和73行是什么意思?不是单向的吗?
"2:编译后的汇编代码(编译成机器码后使用Visual Studio 2008 Team System进行反汇编)"

不知道楼主使用什么工具将你的转换后的汇编代码编译的呢?
会产生临时对象的
干得好,支持你。加油。
re: 大学生活的回忆 小强 2006-03-31 22:35
哈哈,我来踩了,知道我是谁不?