gym 101911】的更多相关文章

A. Coffee Break 题意:每天有m小时,你喝咖啡需要花一小时,你想在n个时刻都喝过一次咖啡,老板规定连续喝咖啡的间隔必须是d以上,求最少需要多少天才能喝够n次咖啡,并输出每个时刻第几天喝. 题解:map+优先队列,用map将愿意喝咖啡的时间喝在第几天喝咖啡映射起来,优先队列遍历每个时刻和上一次喝的时间间隔是否大于d,若大于d,表示可以同一天喝,否则就在下一天喝 #include<iostream> #include<algorithm> #include<math…
题目链接: https://codeforces.com/gym/101911 又补了set的一个知识点,erase(it)之后it这个地址就不存在了,再引用的话就会RE A: ✅ B:  ✅ C:  ✅ D:  ✅ E: https://blog.csdn.net/Link_Ray/article/details/89404428 F:  ✅ G:  https://blog.csdn.net/Link_Ray/article/details/89403094 H: ✅ I: ✅ J: ✅ K…
11.16 树状数组 http://codeforces.com/contest/1070/problem/C digit sum+% dp http://codeforces.com/contest/1070/problem/A 二分 http://codeforces.com/problemset/problem/1070/E 模拟 http://codeforces.com/contest/1070/problem/G 11.12 莫比乌斯反演 http://acm.hdu.edu.cn/…
题目链接:http://codeforces.com/gym/101911/problem/C 问题简述:给定n个细胞以及每个细胞的大小,相同的细胞能进行融合,如果能融合到只剩1个细胞则输出需要额外增加多少细胞才能把全部融合到只剩一个细胞,如果不能则输出-1. 问题分析:每融合一次都要排序,所以用优先队列. /* */ # include <iostream> # include <stdio.h> # include <string.h> # include <…
http://codeforces.com/gym/101911/problem/A Recently Monocarp got a job. His working day lasts exactly m minutes. During work, Monocarp wants to drink coffee at certain moments: there are n minutes a1,a2,…,an , when he is able and willing to take a co…
http://codeforces.com/gym/101911/problem/C Recently Monocarp has created his own mini-laboratory! The laboratory contains n bacteria. Monocarp knows that he can merge any two bacteria having equal sizes, and the resulting bacterium will have the size…
题:https://codeforces.com/gym/101911/problem/A 题意:每天工作m分钟,每次喝coffee得间隔d分钟,然后给出n个数,每个数表示想在一天中的a[i]的时刻喝coffe,问最少喝完的天数 分析:先对数组升序排,若满足间隔的d就向前一个建立联系: #include<bits/stdc++.h> using namespace std; ; int ans[M],head[M]; pair<int,int >a[M]; int main(){…
 Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Andréh and his friend Andréas are board-game aficionados. They know many of their friend…
 Gym 101047K Training with Phuket's larvae Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Thai cuisine is known for combining seasonings so that every dish has flavors that are…
Gym 101047E Escape from Ayutthaya Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u  Practice  Description standard input/output Ayutthaya was one of the first kingdoms in Thailand, spanning since its foundation in 1350 to…