正文
增加 7 行删除 7 行
26 行未改动272829303132333435363738394041424329 行未改动73747576777879808182838485868788899091929394959626 行未改动for(int i = 0; i < node.size(); i ++) used[i] = 0;sort(node.begin(), node.end());int tp = 1;for(int i = 1; i < node.size(); i ++) {while(tp > 1 && (node[stk[tp]] - node[stk[tp - 1]]) *(node[i] - node[stk[tp]]) <= 0) used[stk[tp --]] = 0;stk[++ tp] = i;used[i] = 1;}int tp1 = tp;for(int i = node.size() - 2; i >= 0; i --) {if(!used[i]) {while(tp > tp1 && (node[stk[tp]] - node[stk[tp - 1]]) *(node[i] - node[stk[tp]]) <= 0) used[stk[tp --]] = 0;stk[++ tp] = i;used[i] = 1;}29 行未改动int main() {ios :: sync_with_stdio(false);cin.tie(0), cout.tie(0);cin >> n;for(int i = 1; i <= n; i ++) {cin >> m;for(int j = 1; j <= m; j ++) {LL x, y; cin >> x >> y;vn[i].push_back({x, y});}vn[i] = andrew(vn[i]);}LL ans = 0;vector<pair<LL, LL> > va = solve(1, n);for(auto tmp : va)ans = max(ans, tmp.first * tmp.first + tmp.second * tmp.second);cout << ans;return 0;}```26 行未改动272829303132333435363738394041424329 行未改动73747576777879808182838485868788899091929394959626 行未改动for(int i = 0; i < node.size(); i ++) used[i] = 0;sort(node.begin(), node.end());int tp = 1;for(int i = 1; i < node.size(); i ++) {while(tp > 1 && (node[stk[tp]] - node[stk[tp - 1]]) *(node[i] - node[stk[tp]]) <= 0) used[stk[tp --]] = 0;stk[++ tp] = i;used[i] = 1;}int tp1 = tp;for(int i = node.size() - 2; i >= 0; i --) {if(!used[i]) {while(tp > tp1 && (node[stk[tp]] - node[stk[tp - 1]]) *(node[i] - node[stk[tp]]) <= 0) used[stk[tp --]] = 0;stk[++ tp] = i;used[i] = 1;}29 行未改动int main() {ios :: sync_with_stdio(false);cin.tie(0), cout.tie(0);cin >> n;for(int i = 1; i <= n; i ++) {cin >> m;for(int j = 1; j <= m; j ++) {LL x, y; cin >> x >> y;vn[i].push_back({x, y});}vn[i] = andrew(vn[i]);}LL ans = 0;vector<pair<LL, LL> > va = solve(1, n);for(auto tmp : va)ans = max(ans, tmp.first * tmp.first + tmp.second * tmp.second);cout << ans;return 0;}```