Cod sursa(job #2043465)

Utilizator AndreidgDragomir Andrei Valentin Andreidg Data 20 octombrie 2017 08:16:51
Problema Lupul Urias si Rau Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.74 kb
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 100005;
ifstream f("lupu.in");
ofstream g("lupu.out");

struct car
{
    int lana;
    int d;
}oi[N];

int n,x,l,nh;
int sum = 0;
int pl[N];
vector <int> h;

void urc()
{
    int poz = nh;
    while(poz > 1 && h[poz] >h[poz/2])
    {
        swap(h[poz],h[poz/2]);
        poz = poz / 2;
    }
}
//bool cmp()
int main()
{
    f>>n>>x>>l;
    nh = 0 ;
    for(int i = 1;i <= n; i++)
    {
        int t = 0;
        f>>oi[i].d>>oi[i].lana;
        t = (x-oi[i].d) / l;
        if((x-oi[i].d)%l!=0)
            t++;

        oi[i].d = t;
        //g<<oi[i].d<<"\n";
    }
    f.close();
    g.close();
    return 0;
}