#include <stdio.h>
int arr[100000];
int main()
{
int t, n, k, i, j;
scanf("%d%d", &n, &k);
if(n>2000)
return 0;
for(i=0;i<n;i++)
scanf("%d", &arr[i]);
for(i=0;i<k;i++)
{
for(j=1;j<n;j++)
{
if(arr[j-1]>arr[j])
{
t=arr[j-1];
arr[j-1]=arr[j];
arr[j]=t;
}
}
}
for(i=0;i<n;i++)
printf("%d ", arr[i]);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1472 KB |
Output is correct |
2 |
Correct |
0 ms |
1472 KB |
Output is correct |
3 |
Correct |
0 ms |
1472 KB |
Output is correct |
4 |
Correct |
0 ms |
1472 KB |
Output is correct |
5 |
Correct |
0 ms |
1472 KB |
Output is correct |
6 |
Correct |
0 ms |
1472 KB |
Output is correct |
7 |
Correct |
0 ms |
1472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1472 KB |
Output is correct |
2 |
Correct |
4 ms |
1472 KB |
Output is correct |
3 |
Correct |
0 ms |
1472 KB |
Output is correct |
4 |
Correct |
7 ms |
1472 KB |
Output is correct |
5 |
Correct |
0 ms |
1472 KB |
Output is correct |
6 |
Correct |
0 ms |
1472 KB |
Output is correct |
7 |
Correct |
3 ms |
1472 KB |
Output is correct |
8 |
Correct |
0 ms |
1472 KB |
Output is correct |
9 |
Correct |
0 ms |
1472 KB |
Output is correct |
10 |
Correct |
4 ms |
1472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
1468 KB |
Output isn't correct |