当前位置: 首页 > news >正文

浙江网站改版设计公司购买网站建设合同协议模板

浙江网站改版设计公司,购买网站建设合同协议模板,电脑网站推荐,电商网站设计思维导图思考与总结#xff1a; 1.优先队列#xff0c;先出队列元素不是先进队列的元素#xff0c;而是队列中优先级最高的元素 2.遇到这种题一般把每一个数据封装到一个struct里 3.然后根据优先级判断依据#xff0c;我们通过重定向定义优先队列的优先级 如果我们写bool opera…思考与总结 1.优先队列先出队列元素不是先进队列的元素而是队列中优先级最高的元素 2.遇到这种题一般把每一个数据封装到一个struct里 3.然后根据优先级判断依据我们通过重定向定义优先队列的优先级 如果我们写bool operator 下面return里a b,意味着a的值比b小的话优先级小 4.我们把数据输入优先队列里那队列里就自动为我们排好序了 输出的时候取队列顶端就把优先级大的取出来了 题目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 priority. In this problem, you are asked to simulate the message queue for putting messages to and getting message from the message queue. Input There’s only one test case in the input. Each line is a command, “GET” or “PUT”, which means getting message or putting message. If the command is “PUT”, there’re one string means the message name and two integer means the parameter and priority followed by. There will be at most 60000 command. Note that one message can appear twice or more and if two messages have the same priority, the one comes first will be processed first.(i.e., FIFO for the same priority.) Process to the end-of-file. Output For each “GET” command, output the command getting from the message queue with the name and parameter in one line. If there’s no message in the queue, output “EMPTY QUEUE!”. There’s no output for “PUT” command. Sample Input GET PUT msg1 10 5 PUT msg2 10 4 GET GET GET Sample Output EMPTY QUEUE! msg2 10 msg1 10 EMPTY QUEUE! ac代码 #includeiostream #includealgorithm #includecstdio #includecstdlib #includequeue #includevector #includestring using namespace std;struct node{string a;int b;int c;int num; }; bool operator (const node x,const nodey){if(x.cy.c){return x.numy.num;}else{return x.cy.c;} }int main(){char a[5];priority_queuenodepq;int n1;while(cina){if(a[0]P){struct node l;cinl.a;cinl.b;cinl.c;l.numn;pq.push(l);}if(a[0]G){if(!pq.empty()){struct node llpq.top();pq.pop();coutll.a ll.bendl;}else{coutEMPTY QUEUE!endl;}}} }题目2 看病要排队这个是地球人都知道的常识。 不过经过细心的0068的观察他发现了医院里排队还是有讲究的。0068所去的医院有三个医生汗这么少同时看病。而看病的人病情有轻重所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高级别为1的优先权最低。医生在看病时则会在他的队伍里面选择一个优先权最高的人进行诊治。如果遇到两个优先权一样的病人的话则选择最早来排队的病人。 现在就请你帮助医院模拟这个看病过程。 Input 输入数据包含多组测试请处理到文件结束。 每组数据第一行有一个正整数N(0 N2000)表示发生事件的数目。 接下来有N行分别表示发生的事件。 一共有两种事件 1:”IN A B”,表示有一个拥有优先级B的病人要求医生A诊治。 (0 A3,0 B 10) 2:”OUT A”,表示医生A进行了一次诊治诊治完毕后病人出院。(0 A 3) Output 对于每个”OUT A”事件请在一行里面输出被诊治人的编号ID。如果该事件时无病人需要诊治则输出”EMPTY”。 诊治人的编号ID的定义为在一组测试中”IN A B”事件发生第K次时进来的病人ID即为K。从1开始编号。 Sample Input 7 IN 1 1 IN 1 2 OUT 1 OUT 2 IN 2 1 OUT 2 OUT 1 2 IN 1 1 OUT 1 Sample Output 2 EMPTY 3 1 1 ac代码 #includeiostream #includealgorithm #includecstdio #includecstdlib #includequeue #includestring using namespace std;struct node {int x, y; }; bool operator (const node a, const node b) {if(a.x!b.x){return a.x b.x;}else{return a.y b.y;} }int main() {int n;while(scanf(%d,n)!EOF){int h 1;priority_queuenodeq[4];string aa;int a,b;for(int i0;in;i){cin aa;if(aa IN){struct node p;scanf(%d%d,a,b);p.x b;p.y h;q[a].push(p);h;}else{scanf(%d,a);if(!q[a].empty()){struct node tt;tt q[a].top();q[a].pop();printf(%d\n,tt.y);}else{printf(EMPTY\n);}}}}return 0; }
http://www.zqtcl.cn/news/954201/

相关文章:

  • 建设网站网站多少钱东莞网站建设 光龙
  • 天津和平做网站哪家好搞笑网站建设目的和意义
  • 一般做网站带宽选择多大的wordpress页面侧菜单
  • 海淀青岛网站建设友情链接适用网站
  • 青海建设厅官方网站资阳seo
  • 网站个人备案 企业备案深圳高端网站建设网页设计
  • 网站广东省备案国产最好的a级suv88814
  • 没有公司怎么做网站西安市市政建设网站
  • 北京网站制作net2006装饰网站建设策划书
  • 建立什么网站中小学图书馆网站建设
  • 襄阳网站建设外包任县附近网站建设价格
  • led灯网站建设案例有没有什么东西可以做网站
  • 网站可视化设计企业网络管理系统
  • 优惠券怎做网站南宁网站公司
  • 灌南县规划局网站理想嘉苑规划建设那些公司做网站好
  • 大型网站开发的主流语言wordpress 连接flickr
  • 制作一个网站流程怎样做网站运营
  • 可以完成交易的网站 做微信公众号电商网站开发
  • 上海市建设安全协会官方网站机械加工怎么找客户
  • 郑州驾校网站建设互联网公司可通过数据分析人们的哪些方面
  • 珠海杰作网站建设网络公司做一个关于电影的网页设计
  • 电子商务网站建设需要哪些步骤网站开发维护合同书
  • 顺德网站设计成都网站优化方式
  • 宁波建网站哪家好用点网站后台 更新缓存
  • 如何推广网站链接做旅游网站的目的
  • 网站规划与设计课程设计中企动力网站建设 长春
  • 最新网站建设哪家公司好wordpress 顶部图片
  • 有什么网站可以做一起作业公司简介优秀文案
  • 太仓住房和城乡建设局网站seo网页推广
  • 网络公司 网站源码网页源代码修改了影响别人吗