Cod sursa(job #1953303)

Utilizator B_RazvanBaboiu Razvan B_Razvan Data 4 aprilie 2017 19:10:45
Problema Order Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.72 kb
#include <iostream>
#include <cstdio>

using namespace std;

int n;

struct T
{
    int key, prioritate;
    T *left, *right;
    T() {};
    T(int key, int prioritate, T*left, T*right)
    {
        this->key = key;
        this->prioritate = prioritate;
        this->left = left;
        this->right = right;
    }
}*R, *nil;

void initialize(T*&R)
{
    R = new T(2, 1, NULL, NULL);
}

void insertNode(T*&n, int key, int prioritate)
{

}

void read()
{
    scanf("%d", &n);
    initialize(R);
    for(int i=1; i<=n; ++i)
        insertNode(R, (R->key + i)%n, i);
}

int main()
{
    freopen("order.in", "r", stdin);
    //freopen("order.out", "w", stdout);
    read();
    return 0;
}