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<stdio.h>
#include<stdlib.h>
int main(void)
{
int i, j, k,m;
int a;
int b;
int temp = 0;
int c = 0;
scanf("%d %d", &a, &b);
int* arr = NULL;
arr = (int*)malloc(sizeof(int)*a);
for (i = 0; i < a; i++)
{
scanf("%d", &arr[i]);
}
while (1)
{
if (c == b)
{
break;
}
for (k = 0; k < a - 1; k++)
{
if (arr[k]>arr[k + 1])
{
temp = arr[k];
arr[k] = arr[k + 1];
arr[k + 1] = temp;
}
}
c++;
}
for (m = 0; m < a; m++)
{
printf("%d ", arr[m]);
}
printf("\n");
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... |