This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |