This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
#include<set>
int a,b,i,x[160001];
std::multiset<int>S;
main()
{
scanf("%d%d",&a,&b);
for(i=0;i<a;i++)
{
scanf("%d",&x[i]);
if(i<=b)S.insert(x[i]);
}
for(i=0;i<a;i++)
{
std::multiset<int>::iterator t=S.begin();
printf("%d ",*t);
S.erase(t);
if(i+b+1<a)S.insert(x[i+b+1]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |