#include <stdio.h>
int arr[100001];
int main()
{
int n, k;
scanf("%d%d", &n, &k);
int i, j;
for (i = 1; i <= n; i++)
scanf("%d", &arr[i]);
int temp;
for (i = 1; i <= k; i++)
{
for (j = 1; j < n; j++)
{
if (arr[j]>arr[j + 1])
{
temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
for (i = 1; 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 |
5 ms |
1472 KB |
Output is correct |
3 |
Correct |
2 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 |
2 ms |
1472 KB |
Output is correct |
7 |
Correct |
4 ms |
1472 KB |
Output is correct |
8 |
Correct |
0 ms |
1472 KB |
Output is correct |
9 |
Correct |
4 ms |
1472 KB |
Output is correct |
10 |
Correct |
3 ms |
1472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
2 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
3 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
4 |
Correct |
236 ms |
1472 KB |
Output is correct |
5 |
Correct |
29 ms |
1472 KB |
Output is correct |
6 |
Correct |
112 ms |
1472 KB |
Output is correct |
7 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
8 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
9 |
Correct |
46 ms |
1472 KB |
Output is correct |
10 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
11 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
12 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
13 |
Correct |
28 ms |
1472 KB |
Output is correct |
14 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
15 |
Correct |
111 ms |
1472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
2 |
Correct |
39 ms |
1472 KB |
Output is correct |
3 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
4 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
5 |
Correct |
107 ms |
1472 KB |
Output is correct |
6 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
7 |
Correct |
125 ms |
1472 KB |
Output is correct |
8 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
9 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
10 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
11 |
Correct |
47 ms |
1472 KB |
Output is correct |
12 |
Correct |
27 ms |
1472 KB |
Output is correct |
13 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
14 |
Correct |
235 ms |
1472 KB |
Output is correct |
15 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |