답안 #14152

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14152 2015-05-02T10:11:09 Z gs13105 버블 정렬 (OJUZ10_bubblesort) C++
34 / 100
7 ms 1472 KB
#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;
}
# 결과 실행 시간 메모리 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 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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