当前位置:网站首页>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;
}
边栏推荐
- QT learning diary 8 - resource file addition
- 一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)
- TIPC Getting Started6
- Static variables in static function
- 使用华为性能管理服务,按需配置采样率
- V2x SIM dataset (Shanghai Jiaotong University & New York University)
- Hdu1234 door opener and door closer (water question)
- MTK full dump抓取
- Is the account above changtou school safe?
- Oracle notes
猜你喜欢
Special topic of binary tree -- acwing 3384 Binary tree traversal (known preorder traversal, while building a tree, while outputting middle order traversal)
QT学习日记8——资源文件添加
LabVIEW为什么浮点数会丢失精度
[play with FPGA learning 5 in simple terms ----- reset design]
Hdu1236 ranking (structure Sorting)
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?
JVM garbage collector
[in simple terms, play with FPGA learning 3 ----- basic grammar]
OpenMLDB Meetup No.4 会议纪要
随机推荐
Leetcode 182 Find duplicate email (2022.07.01)
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
Mongodb learning and sorting (condition operator, $type operator, limit() method, skip() method and sort() method)
AppGallery Connect场景化开发实战—图片存储分享
Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
Special topic of binary tree -- acwing 1589 Building binary search tree
What are the software product management systems? Inventory of 12 best product management tools
From Read and save in bag file Jpg pictures and PCD point cloud
[applinking practical case] share in app pictures through applinking
flink二开,实现了个 batch lookup join(附源码)
Special topic of binary tree -- [deep base 16. Example 7] ordinary binary tree (simplified version) (multiset seeks the precursor and subsequent sentry Art)
[AI application] Hikvision ivms-4200 software installation
js中给数组添加元素的方法有哪些
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
PCL extracts a subset from a point cloud
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
Internship report skywalking distributed link tracking?
力扣(LeetCode)182. 查找重复的电子邮箱(2022.07.01)
三.芯片啟動和時鐘系統
sqlite 修改列类型