답안 #14245

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14245 2015-05-07T14:28:43 Z gkwnsals12 버블 정렬 (OJUZ10_bubblesort) C++
0 / 100
37 ms 1356 KB
#include <stdio.h>
int main(void)
{
    FILE *in;
    in=stdin;//fopen("input.txt","r");

    int i,n,a[100001],j,temp,c=0,cn,k;
    fscanf(in,"%d %d",&n,&cn);
    for(i=0;i<n;i++){
        fscanf(in,"%d",&a[i]);
    }


    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            c++;
            if(a[i]>a[j]){
                temp=a[i];
                a[i]=a[j];
                a[j]=temp;
            }
            if(c==cn){
                for(k=0;k<n;k++){
                    printf("%d ",a[k]);
                }
                return 0;
            }
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1352 KB Output isn't correct
2 Incorrect 0 ms 1352 KB Output isn't correct
3 Incorrect 0 ms 1348 KB Output isn't correct
4 Incorrect 0 ms 1348 KB Output isn't correct
5 Incorrect 0 ms 1348 KB Output isn't correct
6 Incorrect 0 ms 1352 KB Output isn't correct
7 Incorrect 0 ms 1348 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1352 KB Output isn't correct
2 Incorrect 0 ms 1356 KB Output isn't correct
3 Incorrect 0 ms 1356 KB Output isn't correct
4 Incorrect 0 ms 1356 KB Output isn't correct
5 Incorrect 0 ms 1352 KB Output isn't correct
6 Incorrect 0 ms 1352 KB Output isn't correct
7 Incorrect 0 ms 1352 KB Output isn't correct
8 Incorrect 0 ms 1348 KB Output isn't correct
9 Incorrect 0 ms 1352 KB Output isn't correct
10 Incorrect 0 ms 1348 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 1352 KB Output isn't correct
2 Incorrect 0 ms 1352 KB Output isn't correct
3 Incorrect 22 ms 1348 KB Output isn't correct
4 Incorrect 25 ms 1356 KB Output isn't correct
5 Incorrect 28 ms 1352 KB Output isn't correct
6 Incorrect 33 ms 1356 KB Output isn't correct
7 Incorrect 28 ms 1352 KB Output isn't correct
8 Incorrect 34 ms 1352 KB Output isn't correct
9 Incorrect 13 ms 1352 KB Output isn't correct
10 Incorrect 21 ms 1356 KB Output isn't correct
11 Incorrect 33 ms 1352 KB Output isn't correct
12 Incorrect 37 ms 1352 KB Output isn't correct
13 Incorrect 26 ms 1348 KB Output isn't correct
14 Incorrect 31 ms 1352 KB Output isn't correct
15 Incorrect 27 ms 1356 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 1348 KB Output isn't correct
2 Incorrect 24 ms 1352 KB Output isn't correct
3 Incorrect 29 ms 1352 KB Output isn't correct
4 Incorrect 31 ms 1348 KB Output isn't correct
5 Incorrect 26 ms 1356 KB Output isn't correct
6 Incorrect 29 ms 1352 KB Output isn't correct
7 Incorrect 0 ms 1352 KB Output isn't correct
8 Incorrect 0 ms 1348 KB Output isn't correct
9 Incorrect 0 ms 1356 KB Output isn't correct
10 Incorrect 26 ms 1356 KB Output isn't correct
11 Incorrect 21 ms 1348 KB Output isn't correct
12 Incorrect 23 ms 1352 KB Output isn't correct
13 Incorrect 0 ms 1348 KB Output isn't correct
14 Incorrect 0 ms 1356 KB Output isn't correct
15 Incorrect 16 ms 1348 KB Output isn't correct