Pagini recente » Cod sursa (job #2820362) | Cod sursa (job #825982) | Cod sursa (job #255875) | Cod sursa (job #337361) | Cod sursa (job #1739359)
#include <fstream>
#include <vector>
#include <climits>
using namespace std;
unsigned int N;
unsigned short int type;
unsigned int x;
vector <int> a;
unsigned int i;
int minimum;
int main ()
{
ifstream fin ("heapuri.in");
ofstream fout ("heapuri.out");
fin >> N;
for (i=1; i<=N; i++)
{
fin >> type;
if (type == 1)
{
fin >> x;
a.push_back(x);
}
else if (type == 2)
{
fin >> x;
a[x] = INT_MAX;
}
else
{
minimum = a[0];
for (i=1; i<=a.size(); i++)
if (a[i] < minimum)
minimum = a[i];
fout << minimum << '\n';
}
}
fin.close();
fout.close();
return 0;
}