版本比较
题解 P5506 【封锁】
正文
增加 11 行删除 11 行
1233456789 行未改动9798991001011011021031041051061071081081091101111124 行未改动11711811912012112112212312312412512612712812913013113113213313413513613713813813914014114234 行未改动17717817918018118118218318418513 行未改动19920020120220320320420520620720820921021121221221321421521617 行未改动2342352362372382382392402412422 行未改动# 这是一道膜你题
还是有做的价值的 **好评** 还是有做的价值的 **好评**
不过数据有点水 对数据表示海星
比赛的时候不管三七二十一一直调 还是不行89 行未改动 //可能有些不必要的语句 就是作以防万一之用 if (abs(p1[f][hee])==abs(p2[f][hee])) { if (abs(x)!=abs(y)) return false; if (abs(p2[f][hee])==1&&abs(x)==0) return false; if (abs(p2[f][hee])==1&&abs(x)==0) return false; if (abs(p2[f][hee])==0&&abs(x)!=0) return false; } if (abs(p2[f][hee])==abs(h[hee])) { if (abs(y)!=abs(z)) return false; if (abs(p2[f][hee])==1&&abs(y)==0) return false; if (abs(p2[f][hee])==0&&abs(y)!=0) return false; if (abs(p2[f][hee])==0&&abs(y)!=0) return false; } if (abs(p1[f][hee])==abs(h[hee])) { if (abs(x)!=abs(z)) return false;4 行未改动}bool pncheck(int x,int y,int z,int hee,int f){ //如果坐标增量为负,那么实际坐标增量也应该是负数 if (p1[f][hee]>0) if (p1[f][hee]>0) { if (!(x>0)) return false; if (!(x>0)) return false; } else if (p1[f][hee]<0) { if (!(x<0)) return false; } if (p2[f][hee]>0) { if (!(y>0)) return false; if (!(y>0)) return false; } else if (p2[f][hee]<0) { if (!(y<0)) return false; }if (h[hee]>0) { if (!(z>0)) return false; if (!(z>0)) return false; } else if (h[hee]<0) { if (!(z<0)) return false;34 行未改动 if (i!=num) { if (plane[i].died==false&&checker(plane[i].x-plane[num].x,plane[i].y-plane[num].y,plane[i].z-plane[num].z,plane[num].h,plane[num].f)) { //cout<<i<<' '; //cout<<i<<' '; mini=min(mini,ou(plane[num].x,plane[i].x,plane[num].y,plane[i].y,plane[num].z,plane[i].z)); } } }//找出符合条件的最小距离13 行未改动 return; //找到了目标 返回 不再寻找 } } }
}int main(void){ cin>>n>>t; for (int i=1;i<=n;i++) { plane[i].died=false; cin>>plane[i].x>>plane[i].y>>plane[i].z>>plane[i].h>>plane[i].f>>plane[i].atk>>plane[i].def>>plane[i].mat>>plane[i].mdf>>plane[i].hp>>plane[i].fix>>plane[i].s; cin>>plane[i].x>>plane[i].y>>plane[i].z>>plane[i].h>>plane[i].f>>plane[i].atk>>plane[i].def>>plane[i].mat>>plane[i].mdf>>plane[i].hp>>plane[i].fix>>plane[i].s; } for (int i=0;i<t;i++) //在每一个时刻 { moveall(); //对每辆无人机操作,先移动17 行未改动}```## 评价
此题解法自然 多种解法兼存 部分分设置适宜 此题解法自然 多种解法兼存 部分分设置适宜
适合作为Luogu比赛中的题目
考察了选手的代码能力2 行未改动