为什么我RE了...求助,谢谢
  • 板块学术版
  • 楼主lmrttx
  • 当前回复5
  • 已保存回复5
  • 发布时间2020/11/6 17:27
  • 上次更新2023/11/5 08:48:06
查看原帖
为什么我RE了...求助,谢谢
344382
lmrttx楼主2020/11/6 17:27

题目:传送门

我的代码:

#include<bits/stdc++.h>
using namespace std;
int n;
priority_queue<int,vector<int>,greater<int> >heap;
int main()
{
	scanf("%d",&n);
	for(/*register*/ int op,i=1;i<=n;i++){
		scanf("%d",&op);
		switch (op) {
			case 1:
				int x;
				scanf("%d",&x);
				heap.push(x);
			case 2:
				printf("%d\n",heap.top());
			case 3:	
			    heap.pop();
		}/*
		if(op=='1') {
			int x;
			scanf("%d",&x);heap.push(x);
		}else if(op=='2'){
			printf("%d\n",heap.top());
		}else heap.pop(); */
	}
	return 0;
}
2020/11/6 17:27
加载中...