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 <iostream>
using namespace std;
int main() {
int i,j,n,s,tmp,A[100001];
cin>>n>>s;
for(i=1;i<=n;i++)
cin>>A[i];
for(i=n;i>=n-s+1;i--)
for (j=1;j<=i-1;j++)
if (A[j]>A[j+1]) {
tmp=A[j];
A[j]=A[j+1];
A[j+1]=tmp;
}
for(i=1;i<=n;i++)
cout<<A[i]<<" ";
return 0;
}
# | 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... |