当前位置:网站首页>Guaba and Computational Geometry
Guaba and Computational Geometry
2022-04-23 06:21:00 【Bzdhxs_ nt】
Code
int a[300005],b[300005],c[300005],d[300005],w[300005];
int n;
struct node{
int l,r,w;
bool operator<(const node&t)const{
return l < t.l;
}
}nod[300005];
int ans = -1;
int mx[300005];
void work(){
sort(nod+1,nod+1+n);
mem(mx,0);
for(int i = n;i;i--) mx[i] = max(mx[n+1],nod[i].w);
forr(i,1,n){
int p = upper_bound(nod+1,nod+1+n,node{
nod[i].r,-1,-1}) - nod;
if(p != n+1) ans = max(ans,nod[i].w + mx[p]);
}
}
void solve(){
ans = -1;
cin>>n;
forr(i,1,n) cin>>a[i]>>b[i]>>c[i]>>d[i];
forr(i,1,n) cin>>w[i];
forr(i,1,n){
nod[i] = {
a[i],c[i],w[i]};
}
work();
forr(i,1,n) nod[i] = {
b[i],d[i],w[i]};
work();
cout << ans << endl;
}
signed main()
{
int t;cin>>t;
while(t--) solve();
return 0;
}
版权声明
本文为[Bzdhxs_ nt]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210617219320.html
边栏推荐
- 治療TensorFlow後遺症——簡單例子記錄torch.utils.data.dataset.Dataset重寫時的圖片維度問題
- Fundamentals of SQL: first knowledge of database and SQL - installation and basic introduction - Alibaba cloud Tianchi
- Advanced operation of idea debug
- 12. Monkeys climb mountains
- Contrôle automatique (version Han min)
- What is the difference between the basic feasible solution and the basic feasible solution in linear programming?
- Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
- Traitement des séquelles du flux de Tensor - exemple simple d'enregistrement de torche. Utils. Données. Dataset. Problème de dimension de l'image lors de la réécriture de l'ensemble de données
- Linear algebra Chapter 1 - determinant
- Anaconda安装PyQt5 和 pyqt5-tools后没有出现designer.exe的问题解决
猜你喜欢
编程记录——图片旋转函数scipy.ndimage.rotate()的简单使用和效果观察
Generate excel template (drop-down selection, multi-level linkage)
Anaconda
In depth understanding of the relationship between dncblevel and noise denoising in the paper
Automatic control (Han min version)
Why does the subscript of the array start from 0 instead of 1?
线性代数第一章-行列式
Pyqt5 learning (I): Layout Management + signal and slot association + menu bar and toolbar + packaging resource package
Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots
Detection technology and principle
随机推荐
Fundamentals of SQL: first knowledge of database and SQL - installation and basic introduction - Alibaba cloud Tianchi
Write your own redistemplate
Pyqy5 learning (2): qmainwindow + QWidget + qlabel
A general U-shaped transformer for image restoration
去噪论文——[Noise2Void,CVPR19]Noise2Void-Learning Denoising from Single Noisy Images
You cannot access this shared folder because your organization's security policy prevents unauthenticated guests from accessing it
Problems and solutions of database migration
In depth understanding of the relationship between dncblevel and noise denoising in the paper
Graphic numpy array matrix
5.The Simple Problem
PHP processing JSON_ Decode() parses JSON stringify
Latex quick start
Framework analysis 2 Source code - login authentication
Class loading and classloader understanding
Anaconda installed pyqt5 and pyqt5 tools without designer Exe problem solving
3. Continuous integer
LDCT图像重建论文——Eformer: Edge Enhancement based Transformer for Medical Image Denoising
Pyemd installation and simple use
Configure domestic image accelerator for yarn
Example of ticket selling with reentrant lock