#include<stdio.h>
void main()
{
int size,count,i,j,x;
int num[100];
scanf("%d %d",&size,&count);
for(i=0;i<size;i++)
scanf("%d",&num[i]);
num[size] = '\0';
for(j=0;j<count;j++){
for(i=1;i<size;i++){
if(num[i-1] > num[i]){
x = num[i-1];
num[i-1] = num[i];
num[i] = x;
}
}
}
for(i=0;i<size;i++)
printf("%d ",num[i]);
//system("PAUSE");
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1084 KB |
Output is correct |
2 |
Correct |
0 ms |
1084 KB |
Output is correct |
3 |
Correct |
0 ms |
1084 KB |
Output is correct |
4 |
Correct |
0 ms |
1084 KB |
Output is correct |
5 |
Correct |
0 ms |
1084 KB |
Output is correct |
6 |
Correct |
0 ms |
1084 KB |
Output is correct |
7 |
Correct |
0 ms |
1084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
2 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
3 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
4 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
5 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
6 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
7 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
8 |
Runtime error |
2 ms |
1084 KB |
SIGSEGV Segmentation fault |
9 |
Runtime error |
0 ms |
1084 KB |
SIGSEGV Segmentation fault |
10 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
2 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
3 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
4 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
5 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
6 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
7 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
8 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
9 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
10 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
11 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
12 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
13 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
14 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
15 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
2 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
3 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
4 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
5 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
6 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
7 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
8 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
9 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
10 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
11 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
12 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
13 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
14 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |
15 |
Runtime error |
0 ms |
1080 KB |
SIGSEGV Segmentation fault |