Submission #17088

# Submission time Handle Problem Language Result Execution time Memory
17088 2015-11-05T06:25:58 Z taehoon1018 버블 정렬 (OJUZ10_bubblesort) C++
34 / 100
1000 ms 1356 KB
#include <stdio.h>

void swap(int *x, int *y)
{
	int temp = *x;
	*x = *y;
	*y = temp;
}

int main(void)
{
	int N, K, arr[100000];

	scanf("%d%d", &N, &K);

	for (int i = 0; i < N; i++)
		scanf("%d", arr + i);

	for (int i = 0; i < K; i++)
		for (int j = 0; j < N - 1; j++)
			if (arr[j] > arr[j + 1])
				swap(arr + j, arr + j + 1);
	for (int i = 0; i < N; i++)
		printf("%d ", arr[i]);
	
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1352 KB Output is correct
2 Correct 0 ms 1348 KB Output is correct
3 Correct 0 ms 1352 KB Output is correct
4 Correct 0 ms 1352 KB Output is correct
5 Correct 0 ms 1352 KB Output is correct
6 Correct 0 ms 1352 KB Output is correct
7 Correct 0 ms 1356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 1356 KB Output is correct
2 Correct 0 ms 1348 KB Output is correct
3 Correct 5 ms 1356 KB Output is correct
4 Correct 0 ms 1352 KB Output is correct
5 Correct 1 ms 1348 KB Output is correct
6 Correct 7 ms 1348 KB Output is correct
7 Correct 4 ms 1352 KB Output is correct
8 Correct 1 ms 1352 KB Output is correct
9 Correct 0 ms 1348 KB Output is correct
10 Correct 0 ms 1348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 1348 KB Output is correct
2 Execution timed out 1000 ms 1344 KB Program timed out
3 Correct 133 ms 1348 KB Output is correct
4 Correct 43 ms 1356 KB Output is correct
5 Correct 240 ms 1356 KB Output is correct
6 Execution timed out 1000 ms 1348 KB Program timed out
7 Execution timed out 1000 ms 1344 KB Program timed out
8 Execution timed out 1000 ms 1348 KB Program timed out
9 Execution timed out 1000 ms 1344 KB Program timed out
10 Execution timed out 1000 ms 1344 KB Program timed out
11 Correct 110 ms 1352 KB Output is correct
12 Execution timed out 1000 ms 1344 KB Program timed out
13 Correct 66 ms 1352 KB Output is correct
14 Execution timed out 1000 ms 1344 KB Program timed out
15 Execution timed out 1000 ms 1348 KB Program timed out
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1348 KB Program timed out
2 Correct 33 ms 1348 KB Output is correct
3 Execution timed out 1000 ms 1348 KB Program timed out
4 Correct 0 ms 1348 KB Output is correct
5 Execution timed out 1000 ms 1344 KB Program timed out
6 Execution timed out 1000 ms 1348 KB Program timed out
7 Execution timed out 1000 ms 1348 KB Program timed out
8 Correct 109 ms 1352 KB Output is correct
9 Correct 240 ms 1348 KB Output is correct
10 Correct 115 ms 1352 KB Output is correct
11 Execution timed out 1000 ms 1344 KB Program timed out
12 Correct 47 ms 1352 KB Output is correct
13 Execution timed out 1000 ms 1348 KB Program timed out
14 Execution timed out 1000 ms 1344 KB Program timed out
15 Execution timed out 1000 ms 1348 KB Program timed out