#define PROBLEM "https://judge.yosupo.jp/problem/rectangle_sum"
#include<bits/stdc++.h>#define REP(i, n) for (int i = 0; i < (n); i++)
#include"library/algebra/group/Add.hpp"
#include"library/datastructure/GroupWaveletMatrix.hpp"
#include"library/r2/Projection.hpp"
#include"library/r2/XY.hpp"usingll=longlong;usingr2=XY<ll>;intmain(){std::ios::sync_with_stdio(false);std::cin.tie(nullptr);intn,q;std::cin>>n>>q;std::vector<r2>r2s(n);std::vector<int>x(n),y(n),w(n);REP(i,n){std::cin>>x[i]>>y[i]>>w[i];r2s[i]=r2(x[i],y[i]);}autoP=Projection(r2s);std::vector<int>Y(P.size(),0);std::vector<ll>W(P.size(),0);REP(id,P.size())Y[id]=P.r(id).y;REP(i,n){intid=P.id(x[i],y[i]);W[id]+=w[i];}GroupWaveletMatrix<int,GroupAdd<ll>>WM(Y,W);REP(j,q){intl,r,d,u;std::cin>>l>>d>>r>>u;auto[L,R]=P.interval(l,r);std::cout<<WM.sum(L,R,d,u)<<"\n";}}
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",line401,inupdateself.update(self._resolve(pathlib.Path(included),included_from=path))~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line401,inupdateself.update(self._resolve(pathlib.Path(included),included_from=path))~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/opt/hostedtoolcache/Python/3.14.0/x64/lib/python3.14/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py",line401,inupdateself.update(self._resolve(pathlib.Path(included),included_from=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:library/algebra/group/Concepts.hpp:line3:#pragmaoncefoundinanon-firstline