STL的应用
deebcjrb
河南省CCPC银牌
展开
-
L2-005 集合相似度(集合)
就是set的基本用法,刚开始用结构体数组半天只得了12分,也不知道错哪里了结构体12分代码#include<iostream>#include<string>#include<math.h>#include<algorithm>#include<vector>#include<queue>#include<bits/stdc++.h>typedef long long ll;#define INF 0x3原创 2020-11-09 23:10:28 · 93 阅读 · 0 评论 -
Codeforces Round #620 (Div. 2) C. Air Conditioner(集合之间的并区间)
http://codeforces.com/contest/1304/problem/C大意:给你两个数n,m,n表示有几个顾客,m表示初始房间温度n行输入,t,l,h,t表示顾客待在房间时间,l表示顾客能接受的最低温度,t表示顾客能接受的最高温度。如果顾客能待在房间里输出yes反之no思路:顾客接受的温度是(l,r),t分钟房间能到达的温服为(l-t,r+t),如果这个集合跟...原创 2020-02-17 17:28:36 · 132 阅读 · 0 评论 -
Codeforces Round #617 (Div. 3) C. Yet Another Walking Robot(map+pair)
There is a robot on a coordinate plane. Initially, the robot is located at the point (0,0)(0,0) . Its path is described as a string ss of length nn consisting of characters 'L', 'R', 'U', 'D'.Each o...原创 2020-02-05 20:43:03 · 130 阅读 · 0 评论 -
Coffee Break(贪心+STL)
Recently Monocarp got a job. His working day lasts exactly mm minutes. During work, Monocarp wants to drink coffee at certain moments: there are nn minutes a1,a2,…,ana1,a2,…,an , when he is able and w...原创 2020-02-02 23:05:59 · 268 阅读 · 0 评论 -
Argus LA 3135(优先队列)
题目:你的任务是编写一个称为Argus的系统。该系统支持一个Register的命令Register Q_num Period该命令注册了一个触发器,它每Period秒钟就会产生一次编号为Q_num的事件。你的任务是模拟出前k个事件。如果多个事件同时发生,先处理Q_num小的事件。思路:优先队列#include <cstdio>#include <ios...原创 2019-10-27 19:09:00 · 106 阅读 · 0 评论