Cod sursă (job #495597)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Lalele (clasele 9-10) | Compilator | cpp | 0.38 kb |
Rundă | lasm_22_10_cl11_12 | Status | evaluat |
Dată | 22 oct. 2019 23:05:44 | Scor | 0 |
#include <bits/stdc++.h>
using namespace std;
long long p[5000001],k=0,z,d,n,t=0,aux=0,i;
int main ()
{
ifstream cin ("lalele.in");
ofstream cout ("lalele.out");
cin>>n;
while (cin>>z>>d)
{
for (i=1;i<=z;i++)
{
aux++;
nth_element(p+1,p+k/2+1,p+k+1);
cout<<p[k/2+1]+aux<<'\n';
k/=2;
}
}
return 0;
}