| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1347264 | jahongir | Bubble Sort 2 (JOI18_bubblesort2) | C++20 | 9091 ms | 580 KiB |
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){
int N = (int) A.size();
int Q = (int) X.size();
vector<int> res(Q,0);
for(int t = 0; t < Q; t++){
A[X[t]] = V[t];
auto vec = A;
bool a = 1;
for(int i = N-1; i > 0 && a; i--){
a = 0;
for(int j = 0; j < i; j++)
if(vec[j] > vec[j+1]){
a = 1; swap(vec[j],vec[j+1]);
}
if(a==0) break;
res[t]++;
}
}
return res;
}| # | 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... | ||||
