1 solutions

  • -2
    @ 2024-7-22 11:22:20
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	priority_queue<int> q;
    	int n;
    	cin>>n;
    	while(n--)
    	{
    		int op;
    		cin>>op;
    		if(op==1)
    		{
    			int x;
    			cin>>x;
    			q.push(x);
    		}
    		else if(op==2)
    		{
    			cout<<q.top()<<endl;
    		}
    		else
    		{
    			q.pop();
    		}
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    164
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    24
    Accepted
    15
    Uploaded By