摘要: A. Coffee Break 题意:每天有m小时,你喝咖啡需要花一小时,你想在n个时刻都喝过一次咖啡,老板规定连续喝咖啡的间隔必须是d以上,求最少需要多少天才能喝够n次咖啡,并输出每个时刻第几天喝。 题解:map+优先队列,用map将愿意喝咖啡的时间喝在第几天喝咖啡映射起来,优先队列遍历每个时刻和 阅读全文
posted @ 2019-08-11 22:19 知道了呀~ 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 一、迭代器iterator 迭代器是容器的一种遍历方式,每种容器都定义了自己的迭代器类型 声明一个迭代器: 容器名称<数据类型>::iterator 迭代器名称 vector<int>::iterator it; map<int,int>::iterator it; set<int>::iterat 阅读全文
posted @ 2019-08-11 18:41 知道了呀~ 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Dining Description Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others. Farmer John h 阅读全文
posted @ 2019-08-11 15:19 知道了呀~ 阅读(297) 评论(0) 推荐(0) 编辑