Submission #14195

# Submission time Handle Problem Language Result Execution time Memory
14195 2015-05-03T13:07:31 Z ainu7 버블 정렬 (OJUZ10_bubblesort) C++
34 / 100
1000 ms 2108 KB
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <set>
using namespace std;

int main()
{
  int N, K;
  cin >> N >> K;
  vector<int> V(N);
  for (int i=0; i<N; i++) cin >> V[i];

  for (int i=0; i<K; i++) {
    for (int j=0; j<N-1; j++)
      if (V[j] > V[j+1]) swap(V[j], V[j+1]);
  }

  for (int i=0; i<N; i++)
    cout << V[i] << " ";
  cout << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1716 KB Output is correct
2 Correct 0 ms 1716 KB Output is correct
3 Correct 0 ms 1716 KB Output is correct
4 Correct 0 ms 1716 KB Output is correct
5 Correct 0 ms 1716 KB Output is correct
6 Correct 0 ms 1716 KB Output is correct
7 Correct 0 ms 1716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1716 KB Output is correct
2 Correct 4 ms 1716 KB Output is correct
3 Correct 2 ms 1716 KB Output is correct
4 Correct 4 ms 1716 KB Output is correct
5 Correct 0 ms 1716 KB Output is correct
6 Correct 5 ms 1716 KB Output is correct
7 Correct 0 ms 1716 KB Output is correct
8 Correct 8 ms 1716 KB Output is correct
9 Correct 3 ms 1716 KB Output is correct
10 Correct 4 ms 1716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 1988 KB Program timed out
2 Execution timed out 1000 ms 2104 KB Program timed out
3 Execution timed out 1000 ms 2104 KB Program timed out
4 Correct 129 ms 1868 KB Output is correct
5 Execution timed out 1000 ms 2024 KB Program timed out
6 Execution timed out 1000 ms 2104 KB Program timed out
7 Correct 155 ms 2108 KB Output is correct
8 Correct 53 ms 2108 KB Output is correct
9 Execution timed out 1000 ms 2060 KB Program timed out
10 Execution timed out 1000 ms 2104 KB Program timed out
11 Correct 92 ms 2108 KB Output is correct
12 Execution timed out 1000 ms 2104 KB Program timed out
13 Correct 281 ms 2108 KB Output is correct
14 Execution timed out 1000 ms 2104 KB Program timed out
15 Correct 70 ms 2108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1000 ms 2060 KB Program timed out
2 Correct 73 ms 2108 KB Output is correct
3 Correct 155 ms 2108 KB Output is correct
4 Correct 120 ms 1868 KB Output is correct
5 Execution timed out 1000 ms 2024 KB Program timed out
6 Correct 267 ms 2108 KB Output is correct
7 Correct 69 ms 2108 KB Output is correct
8 Execution timed out 1000 ms 2104 KB Program timed out
9 Correct 95 ms 2108 KB Output is correct
10 Execution timed out 1000 ms 2104 KB Program timed out
11 Execution timed out 1000 ms 2104 KB Program timed out
12 Execution timed out 1000 ms 2104 KB Program timed out
13 Execution timed out 1000 ms 1988 KB Program timed out
14 Execution timed out 1000 ms 2104 KB Program timed out
15 Execution timed out 1000 ms 2104 KB Program timed out