Cod sursa(job #2168290)

Utilizator adriangh3Adrian Gheorghiu adriangh3 Data 14 martie 2018 10:18:07
Problema Heapuri Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.71 kb
#include <fstream>
using namespace std;
ifstream in("heapuri.in");
ofstream out("heapuri.out");
int *H=new int[200010];

inline int father(int nod)
{
    return nod/2;
}

inline int left_son(int nod)
{
    return nod*2;
}

inline int right_son(int nod)
{
    return nod*2+1;
}

void sift(int nod)
{
    int son;
    while(left_son(nod)<=N)
    {
        son=left_son(k);
        if(right_son(nod)<=N&&H[right_son(nod)]>son) son=right_son(nod);
    }
}

int main()
{
    int n, op, x;
    for(int i=0;i<n;i++)
    {
        in>>op;
        if(op==1)
        {

        }
        else if(op==2)
        {

        }
        else
        {

        }
    }
    return 0;
}