杀蚂蚁
1.所有炮台是一起选择目标,选完之后一起打
2.如果蚂蚁这一秒没有移动位置,仍然要判断它是否会抗蛋糕,因为上一秒抗蛋糕的可能死了
3.蚂蚁的半径是0.5
4.只有洞口没有蚂蚁时新蚂蚁才会出来
链表存蚂蚁比较方便
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define maxn 400005
using namespace std;
int n,m,T;
int num_po,hurt,R,pos_cake;//pos_cake 蛋糕在的蚂蚁编号
int cnt=0,now;
int last,pre[maxn],nex[maxn];
int vis[10][10],w[10][10];
bool die[maxn];
struct node
{
int w,f;
}b[5];
struct node2
{
double dis;
int id;
}c[maxn];
bool cmp(const node&x,const node&y)
{
return x.w==y.w ? x.f<y.f : x.w>y.w;
}
bool cmp2(const node2&x,const node2&y)
{
return x.dis==y.dis ? x.id<y.id : x.dis<y.dis;
}
inline int read()
{
int x=0;
char ch=getchar();
while(ch<'0'||ch>'9') ch=getchar();
while(ch>='0'&&ch<='9'){ x=x*10+ch-'0'; ch=getchar(); }
return x;
}
double sq(int x)//平方
{
return (double)x*(double)x*1.0;
}
struct Ant//蚂蚁信息
{
int id;
int x,y,lastx,lasty;//当前位置 上一次位置
int blood,age,d,ti,bl;//血量 年龄 等级 活动时间 初始血量
bool cake; //有没有抗蛋糕
double quickpow(int x)
{
double op=1.0,e=1.1;
while(x){
if(x&1) op*=e;
e*=e;
x>>=1;
}
return op;
}
void init()
{
id=cnt;
if(id%6==0) d=id/6;
else d=id/6+1;
blood=(int)((double)4*quickpow(d));
bl=blood;
age=ti=x=y=0;
lastx=lasty=0;
vis[x][y]++; //该点的蚂蚁数
}
void