# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15640 | ggoh | 버블 정렬 (OJUZ10_bubblesort) | C++98 | 0 ms | 0 KiB |
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]);
}
}