#include<cstdio>
#include<algorithm>
using namespace std;
int n,k,a[100005];
int main()
{
int i,j,t;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<k;i++)
for(j=0;j<n-1;j++)
if(a[j]>a[j+1]){
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
for(i=0;i<n;i++)printf("%d ",a[i]);
}
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
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 |
0 ms |
1472 KB |
Output is correct |
5 |
Correct |
0 ms |
1472 KB |
Output is correct |
6 |
Correct |
8 ms |
1472 KB |
Output is correct |
7 |
Correct |
0 ms |
1472 KB |
Output is correct |
8 |
Correct |
0 ms |
1472 KB |
Output is correct |
9 |
Correct |
3 ms |
1472 KB |
Output is correct |
10 |
Correct |
5 ms |
1472 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
Correct |
247 ms |
1472 KB |
Output is correct |
4 |
Correct |
29 ms |
1472 KB |
Output is correct |
5 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
6 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
7 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
8 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
9 |
Correct |
108 ms |
1472 KB |
Output is correct |
10 |
Correct |
115 ms |
1472 KB |
Output is correct |
11 |
Correct |
53 ms |
1472 KB |
Output is correct |
12 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
13 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
14 |
Correct |
27 ms |
1472 KB |
Output is correct |
15 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
# |
결과 |
실행 시간 |
메모리 |
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 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
5 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
6 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
7 |
Correct |
53 ms |
1472 KB |
Output is correct |
8 |
Correct |
29 ms |
1472 KB |
Output is correct |
9 |
Correct |
115 ms |
1472 KB |
Output is correct |
10 |
Correct |
247 ms |
1472 KB |
Output is correct |
11 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
12 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
13 |
Execution timed out |
1000 ms |
1468 KB |
Program timed out |
14 |
Correct |
112 ms |
1472 KB |
Output is correct |
15 |
Correct |
36 ms |
1472 KB |
Output is correct |