ZJOI2008 殺螞蟻 BZOJ上未過

2021-08-14 11:21:24 字數 1866 閱讀 9202

dark模擬題。

計算幾何一片空白判線段和圓是否相交來來回回改了五六次,**也寫得很長(還有一部分原因是碼風問題233)

提交記錄非常鬼畜:先在codevs上wa40,把inline全部去掉就ac了;再到洛谷上還是wa40,把o2關掉變成80,陣列開大點就ac了。但是bzoj上還是wa。

如果哪位大佬幫我看出**有點問題(也有可能是比較危險的未定義行為)或者有叉掉我的資料麻煩指出一下,非常感激。

#include#include#include#include#include#include#include#include#include#include#include#include#define ll long long

#define int long long

using namespace std;

const int n=2e5+10;

const int mod=1e9+7;

const int inf=0x3f3f3f3f;

const int u[4]=;

const int v[4]=;

namespace fastio

templatevoid write(tp x)

templatevoid writeln(tp x)

}using namespace fastio;

int n,m,t,s,d,r,t,game_end;

int antin[15][15],hp_level[n];

struct point map[15][15];

namespace information_ant ant[10],move[10];

void ant_born() ;

antin[1][1]=1; }

void ant_put() }

int can_go(int x,int y)

int pre(int x)

void ant_move(int p)

}} if (~to&&ant[p].time%5==4)

}} ant[p].lasx=x; ant[p].lasy=y;

if (~to)

if (target==-1&&x==n&&y==m) }

void ant_die()

for (int i=1;i<=alive;i++)

ant[i]=move[i];

num_ant=alive; target=-1;

for (int i=1;i<=alive;i++)

if (ant[i].cake) target=i; }

};using namespace information_ant;

namespace information_tower

}tower[200];

int dis(int p,int q)

int can_attack(int p,int goal)

int check_ver(int u,int v,int w) ;

vector b=(vector) ;

return a.dot(b)>=0; }

int attacked(int p,int q,int goal) ;

ant[0].x=tower[p].x; ant[0].y=tower[p].y;

if (check_ver(p,goal,q)&&check_ver(0,0,q)) }

void tower_attack(int p)

int minv=inf,goal=-1;

for (int i=1;i<=num_ant;i++) {

int dx=dis(p,i);

if (dx<=r*r&&dx

ZJOI2008 殺螞蟻antbuster 題解

乙個題目的可讀版本 這兩天做的又一道大模擬題,感覺這玩意有毒,會上癮啊 比起豬國殺這道題真心不知道高到 去了,當然,我只是說題目。具體難度說句實在地,真覺得比豬國殺要容易一些。先說一下時間線 第一天下午 打完豬國殺,立志殺螞蟻。第二天下午 3 00 開搞,讀題,掃雷。3 30 正式打碼。5 20 完...

ZJOI2008 騎士 題解

題面 這道題稍微想一想就會聯想到樹形dp的入門題 沒有上司的舞會 但是再想一想會發現這根本就不是一顆樹,因為它比樹多了一條邊 這時候我們引入乙個新的概念 基環樹 顧名思義 基環樹就是在一顆樹上填一條邊構成的乙個圖 基環樹也叫環套樹 明明更像樹套環 我們在樹上可以做的事情基本都可以在基環樹上實現 比如...

ZJOI 2008 樹的統計

一棵樹上有n個節點,編號分別為1到n,每個節點都有乙個權值w。我們將以下面的形式來要求你對這棵樹完成一些操作 i.change u t 把結點u的權值改為t ii.qmax u v 詢問從點u到點v的路徑上的節點的最大權值 iii.qsum u v 詢問從點u到點v的路徑上的節點的權值和 注意 從點...