답안 #14562

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
14562 2015-05-20T02:45:31 Z eric4266 버블 정렬 (OJUZ10_bubblesort) C++
34 / 100
1000 ms 1984 KB
#include <iostream>
using namespace std;
int main() {
	int i,j,n,s,tmp,A[100001];
	cin>>n>>s;
	for(i=1;i<=n;i++)
		cin>>A[i];
	for(i=n;i>=n-s+1;i--)
		for (j=1;j<=i-1;j++)
			if (A[j]>A[j+1]) {
				tmp=A[j];
				A[j]=A[j+1];
				A[j+1]=tmp;
			}
	for(i=1;i<=n;i++)
		cout<<A[i]<<" ";
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1980 KB Output is correct
2 Correct 0 ms 1984 KB Output is correct
3 Correct 0 ms 1980 KB Output is correct
4 Correct 0 ms 1980 KB Output is correct
5 Correct 0 ms 1980 KB Output is correct
6 Correct 0 ms 1980 KB Output is correct
7 Correct 0 ms 1980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1984 KB Output is correct
2 Correct 0 ms 1980 KB Output is correct
3 Correct 0 ms 1984 KB Output is correct
4 Correct 4 ms 1984 KB Output is correct
5 Correct 0 ms 1980 KB Output is correct
6 Correct 4 ms 1984 KB Output is correct
7 Correct 0 ms 1984 KB Output is correct
8 Correct 0 ms 1980 KB Output is correct
9 Correct 4 ms 1980 KB Output is correct
10 Correct 3 ms 1980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 148 ms 1980 KB Output is correct
2 Execution timed out 1000 ms 1976 KB Program timed out
3 Execution timed out 1000 ms 1976 KB Program timed out
4 Correct 284 ms 1984 KB Output is correct
5 Execution timed out 1000 ms 1972 KB Program timed out
6 Correct 67 ms 1984 KB Output is correct
7 Correct 121 ms 1980 KB Output is correct
8 Correct 88 ms 1984 KB Output is correct
9 Execution timed out 1000 ms 1976 KB Program timed out
10 Execution timed out 1000 ms 1976 KB Program timed out
11 Execution timed out 1000 ms 1980 KB Program timed out
12 Correct 57 ms 1980 KB Output is correct
13 Execution timed out 1000 ms 1980 KB Program timed out
14 Execution timed out 1000 ms 1976 KB Program timed out
15 Execution timed out 1000 ms 1976 KB Program timed out
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 1980 KB Program timed out
2 Execution timed out 1000 ms 1980 KB Program timed out
3 Correct 85 ms 1984 KB Output is correct
4 Execution timed out 1000 ms 1976 KB Program timed out
5 Execution timed out 1000 ms 1976 KB Program timed out
6 Execution timed out 1000 ms 1972 KB Program timed out
7 Correct 293 ms 1980 KB Output is correct
8 Correct 138 ms 1980 KB Output is correct
9 Execution timed out 1000 ms 1980 KB Program timed out
10 Execution timed out 1000 ms 1972 KB Program timed out
11 Execution timed out 1000 ms 1976 KB Program timed out
12 Execution timed out 1000 ms 1980 KB Program timed out
13 Correct 72 ms 1980 KB Output is correct
14 Correct 45 ms 1980 KB Output is correct
15 Correct 121 ms 1980 KB Output is correct