当前位置:网站首页>Supermarket (heap overload
Supermarket (heap overload
2022-07-02 11:11:00 【lcxdz】
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+9;
int arr[N];
int n,m,q;
struct node {
int price,id,ed;
bool operator< (const node &ch)const{
if(ch.price!=price)return ch.price<price;
return ch.id<id;
}
};
priority_queue<node> h;
vector<node> v[N];
int main(){
cin>>n>>m>>q;
for(int i=1;i<=n;i++){
scanf("%d",&arr[i]);
h.push({
arr[i],i,m});
}
while(q--){
int x,y,l,r;
scanf("%d%d%d%d",&x,&y,&l,&r);
if(y<10)y*=10;
int p=arr[x]*y/100;
v[l].push_back({
p,x,r});
}
for(int i=1;i<=m;i++){
for(int j=0;j<v[i].size();j++)h.push(v[i][j]);
while(h.size()&&h.top().ed<i)h.pop();
cout<<h.top().id<<" ";
}
return 0;
}
边栏推荐
- C# 文件与文件夹操作
- Appgallery connect scenario development practice - image storage and sharing
- Point cloud projection picture
- Regular and common formulas
- Calculate the sum of sequences
- TIPC Getting Started6
- I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)
- How to implement tabbar title bar with list component
- Oracle notes
- 力扣(LeetCode)182. 查找重复的电子邮箱(2022.07.01)
猜你喜欢

Huawei game failed to initialize init with error code 907135000

华为应用市场应用统计数据问题大揭秘

V2x SIM dataset (Shanghai Jiaotong University & New York University)
![[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?](/img/66/674a06d8e45a31ae879b81554ef373.png)
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?

JSP webshell免殺——JSP的基礎

TIPC Cluster5

首份中国企业敏捷实践白皮书发布| 附完整下载

二叉树专题--洛谷 P1229 遍历问题(乘法原理 已知前、后序遍历求中序遍历个数)

快应用中实现自定义抽屉组件

TIPC messaging3
随机推荐
全网显示 IP 归属地,是怎么实现的?
PCL extracts a subset from a point cloud
TIPC协议
Why does LabVIEW lose precision in floating point numbers
【AI应用】海康威视iVMS-4200软件安装
Hdu1228 a + B (map mapping)
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
Implementation of six singleton modes
OpenMLDB Meetup No.4 会议纪要
【付费推广】常见问题合集,推荐榜单FAQ
III Chip startup and clock system
Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
[ark UI] implementation of the startup page of harmonios ETS
Overview of integrated learning
One trick to quickly realize custom application titlebar
P1055 [noip2008 popularization group] ISBN number
JSP webshell free -- webshell free
Calculate the sum of sequences
Uncover the secrets of Huawei application market application statistics
如何用list组件实现tabbar标题栏