Esempio n. 1
0
int main()
{
	//freopen("/home/qitaishui/code/in.txt","r",stdin);
	int n,m=0,u,v,ans;
	scanf("%d",&n);
	for(int i = 0; i < n;i++)
		p[i].input();
	for(int i = 0; i < n; i++)
		for(int j = i+1; j < n; j++)
			seg[m++] = Node(i,j,(p[i].x-p[j].x)*(p[i].x-p[j].x)+(p[i].y-p[j].y)*(p[i].y-p[j].y));
	sort(seg,seg+m);
	//cout<<"*\n";
	for(int i = 0; i < m; i++)
	{
		u = seg[i].u,v = seg[i].v;
		tmp = bit[u]&bit[v];
		//cout<<u<<endl;
		if(tmp.any())
		{
			ans = seg[i].d;
			break;
		}
		bit[u].set(v);
		bit[v].set(u);
	}
	//cout<<ans<<endl;
	printf("%.10f\n",sqrt(1.0*ans)/2);
	return 0;
}
Esempio n. 2
0
bitset<BITS> HamiltonMatrix::removeParticle(int n, bitset<BITS> state) {
    // Vacuum state
    if (state.any() == false)
        return state;

    bitset<BITS> a;
    a.set(n - 1);
    bitset<BITS> comp = a & state;

    if (comp.count() == true) {
        state.set(n - 1, 0);
    } else {
        state.reset();
    }

    return state;
}