随笔分类 - 数据结构-优先队列
摘要:
一批幸福的列车即将从杭州驶向幸福的终点站——温州,身为总列车长的linle有一些奇怪的癖好。
他会记录下全部乘客的名字(name)和他们的人品值(RP),根据这些将他们排序,并不时地从某辆列车里踢出人品最不好(RP值最低)的一个人,当两个人人品一样不好时,他就会踢出名字难听的人(linle认为按字典顺序,排在越在后面的人名字越难听)。
当然出于列车行驶需要,他还会不时的发布一些命令,比如让某个乘客上车,合并某两辆列车等。
linle的上一任秘书***因为不能高效地执行他的这些命令而被炒鱿鱼,他现在正在寻觅新的秘书人选,你能不能胜任呢?(谢绝男士,待遇丰厚~~~)
阅读全文
一批幸福的列车即将从杭州驶向幸福的终点站——温州,身为总列车长的linle有一些奇怪的癖好。
他会记录下全部乘客的名字(name)和他们的人品值(RP),根据这些将他们排序,并不时地从某辆列车里踢出人品最不好(RP值最低)的一个人,当两个人人品一样不好时,他就会踢出名字难听的人(linle认为按字典顺序,排在越在后面的人名字越难听)。
当然出于列车行驶需要,他还会不时的发布一些命令,比如让某个乘客上车,合并某两辆列车等。
linle的上一任秘书***因为不能高效地执行他的这些命令而被炒鱿鱼,他现在正在寻觅新的秘书人选,你能不能胜任呢?(谢绝男士,待遇丰厚~~~)
阅读全文
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3288Resource AllocationDescriptionHDU-Sailormoon is made up of three girls~~~wj, xq, lff, usually they w...
阅读全文
摘要:
看病要排队这个是地球人都知道的常识。
不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话,则选择最早来排队的病人。
现在就请你帮助医院模拟这个看病过程。
阅读全文
看病要排队这个是地球人都知道的常识。
不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话,则选择最早来排队的病人。
现在就请你帮助医院模拟这个看病过程。
阅读全文
摘要:
Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the system will add a message to the queue. Meanwhile, the process will do a loop for getting message from the queue according to the priority value if it is not empty. Note that the less priority value means the higher pr
阅读全文
Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If something happens to this process, such as mouse click, text change, the system will add a message to the queue. Meanwhile, the process will do a loop for getting message from the queue according to the priority value if it is not empty. Note that the less priority value means the higher pr
阅读全文
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058优先队列的应用,如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using st...
阅读全文
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2275题意:n个操作Push 入容器Pop弹出一个 满足 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #incl...
阅读全文
摘要:原题链接:http://poj.org/problem?id=1338优先队列的应用,如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 typedef long...
阅读全文
摘要:原题链接:http://poj.org/problem?id=1862简单题,贪心+优先队列主要练习一下stl大根堆写了几种实现方式写成类的形式还是要慢一些。。。手打的heap:1: 1 #include 2 #include 3 #include 4 #include 5 class Soluti...
阅读全文

浙公网安备 33010602011771号