이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bubblesort2.h"
#include<bits/stdc++.h>
std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){
int n = A.size();
int q = X.size();
std::vector<int> answer;
for (int i = 0; i < q; ++i)
{
A[X[i]] = V[i];
std::vector<int> B = A;
int ct = 0;
for (int j = 0; j < n; ++j)
{
bool s = false;
for (int k = 0; k < n-j-1; ++k)
{
if (B[k] > B[k+1]) {std::swap(B[k], B[k+1]); s = true;}
}
if (!s) {break;}
++ct;
}
answer.push_back(ct);
}
return answer;
}
# | 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... |