/**
* Author: chilli, Takanori MAEHARA
* Date: 2019-11-02
* License: CC0
* Source: https://github.com/spaghetti-source/algorithm/blob/master/geometry/rectilinear_mst.cc
* Description: Given N points, returns up to 4*N edges, which are guaranteed
* to contain a minimum spanning tree for the graph with edge weights w(p, q) =
* |p.x - q.x| + |p.y - q.y|. Edges are in the form (distance, src, dst). Use a
* standard MST algorithm on the result to find the final MST.
* Time: O(N \log N)
* Status: Stress-tested
*/#pragma once
#include"src/geometry/Point.h"typedefPoint<int>P;vector<array<int,3>>manhattanMST(vector<P>ps){viid(sz(ps));iota(all(id),0);vector<array<int,3>>edges;rep(k,0,4){sort(all(id),[&](inti,intj){return(ps[i]-ps[j]).x<(ps[j]-ps[i]).y;});map<int,int>sweep;for(inti:id){for(autoit=sweep.lower_bound(-ps[i].y);it!=sweep.end();sweep.erase(it++)){intj=it->second;Pd=ps[i]-ps[j];if(d.y>d.x)break;edges.push_back({d.y+d.x,i,j});}sweep[-ps[i].y]=i;}for(P&p:ps)if(k&1)p.x=-p.x;elseswap(p.x,p.y);}returnedges;}
Traceback(mostrecentcalllast):File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/documentation/build.py",line71,in_render_source_code_statbundled_code=language.bundle(stat.path,basedir=basedir,options={'include_paths':[basedir]}).decode()~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus.py",line187,inbundlebundler.update(path)~~~~~~~~~~~~~~^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line312,inupdateraiseBundleErrorAt(path,i+1,"#pragma once found in a non-first line")onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt:src/geometry/ManhattanMST.h:line13:#pragmaoncefoundinanon-firstline