1 class Twitter 2 { 3 public: 4 unordered_map<int,priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>>> u;//用户 -> (出现的次数,推文) 小根堆 ...
分类:
其他好文 时间:
2020-04-22 23:00:19
阅读次数:
114
链接 https://www.acwing.com/problem/content/1133/ 题目 1944 年,特种兵麦克接到国防部的命令,要求立即赶赴太平洋上的一个孤岛,营救被敌军俘虏的大兵瑞恩。 瑞恩被关押在一个迷宫里,迷宫地形复杂,但幸好麦克得到了迷宫的地形图。 迷宫的外形是一个长方形,其 ...
分类:
其他好文 时间:
2020-04-22 19:46:53
阅读次数:
277
1 class Solution 2 { 3 public: 4 vector<int> topKFrequent(vector<int>& nums, int k) 5 { 6 vector<int> res; 7 unordered_map<int,int> hash; 8 for(auto a ...
分类:
其他好文 时间:
2020-04-22 19:38:30
阅读次数:
43
配置中心指定profile后启动报错 2020-04-22 14:35:48.306 ERROR 22828 [ restartedMain] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Excep ...
分类:
编程语言 时间:
2020-04-22 14:49:48
阅读次数:
908
二、容器 18.java 容器都有哪些? 如图: 首先分为Collection、Map; Collection下分为List、Set和Queue; List下分为ArrayList和LinkedList; Set下分为HashSet、LinkedHashSet和TreeSet; Queue下有Pri ...
分类:
编程语言 时间:
2020-04-22 12:51:47
阅读次数:
59
Topic 模式 重点是理解交换器(exchange)、路由键(routing key)、队列名(queue name)三者之间的绑定关系。 topic 发送方: 发送方 关注参数主要有三个 交换器(exchange) 路由键(routing key) 和 消息 topic 消费方 消费方 关注点是 ...
分类:
编程语言 时间:
2020-04-22 00:13:18
阅读次数:
64
https://www.cnblogs.com/penseur/archive/2013/06/16/3138981.html #include<iostream> #include<queue> using namespace std; const int MAXN=500;// 最大点数 con ...
分类:
编程语言 时间:
2020-04-21 18:19:26
阅读次数:
81
D D HDU 3282 思路 题意:给我一个奇数长度为n的序列,从左到右依次输出 1~当前技术位置的 这个子区间内的中位数。 思路 1 .法一: 维护一个最小根堆、最大根堆(注意less 在priority_queue 中的数字排列的顺序是按从头部top 按数字大小逐渐递减,而gerater 在p ...
分类:
其他好文 时间:
2020-04-21 12:54:09
阅读次数:
59
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 ...
分类:
其他好文 时间:
2020-04-21 09:51:36
阅读次数:
66
svn更新又一次出现问题,cleanup 失败。原因: svn的本地数据库wc.db中的表WC_LOCK和WORK_QUEUE中存在记录。解决方法: 把.svn文件wc.db中表WC_LOCK和WORK_QUEUE中的记录删除。 备注:把wc.db使用Navicat打开。双击打开左侧的表WC_LOC ...
分类:
其他好文 时间:
2020-04-20 15:52:09
阅读次数:
82