2026/2/26 12:24:47
网站建设
项目流程
高端网站建设公司注意什么,dede可以做购物网站吗,网站建设5000费用预算,校企合作网站建设Problem: 789. Escape The Ghosts 逃脱阻碍者 解题过程 耗时100%#xff0c;计算起点到终点的距离#xff0c;因只能上下左右几个方向#xff0c;所以距离就是坐标之间的差的绝对值之和#xff0c;若本人距离更近#xff0c;则一定可以逃脱#xff1b;否则一定会被阻拦到…Problem: 789. Escape The Ghosts 逃脱阻碍者解题过程耗时100%计算起点到终点的距离因只能上下左右几个方向所以距离就是坐标之间的差的绝对值之和若本人距离更近则一定可以逃脱否则一定会被阻拦到Codeclass Solution { public: bool escapeGhosts(vectorvectorint ghosts, vectorint target) { int mi INT_MAX, myt; myt abs(target[0]) abs(target[1]); for(int i 0; i ghosts.size(); i) { mi min(mi, abs(ghosts[i][0] - target[0]) abs(ghosts[i][1] - target[1])); } return myt mi; } };