Pagini recente » Cod sursa (job #916564) | Istoria paginii utilizator/giovani | Statistici silviu ionut (lutu) | Cod sursa (job #548940) | Cod sursa (job #1732856)
#include <fstream>
#include <set>
#include <vector>
using namespace std ;
ifstream f ("heapuri.in") ;
ofstream g ("heapuri.out") ;
multiset <int> H ;
vector <int> V ;
int N ;
int main ()
{
f >> N ;
for ( ; N ; --N )
{
int tip , x ;
f >> tip ;
if ( tip == 1 )
{
f >> x ;
V.push_back ( x ) ;
H.insert ( x ) ;
}
if ( tip == 2 )
{
f >> x ;
H.erase ( V[x-1] ) ;
}
if ( tip == 3 )
g << *H.begin() << "\n" ;
}
}