Submission #421640

# Submission time Handle Problem Language Result Execution time Memory
421640 2021-06-09T10:20:39 Z 반딧불(#7622) Bubble Sort 2 (JOI18_bubblesort2) C++17
0 / 100
66 ms 756 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, q;
vector<pair<int, int> > vec;
int arr[500002];
vector<int> ans;

vector<int> countScans(vector<int> A, vector<int> X, vector<int> V){
	n = (int)A.size();
	q = (int)X.size();
	for(int i=1; i<=n; i++){
        arr[i] = A[i-1];
	}

    for(int i=0; i<q; i++){
        arr[X[i]+1] = V[i];
        int tmp = n, ret = n-1;
        for(int i=n-1; i>=1; i--){
            if(arr[tmp] >= arr[i]) tmp = i, ret--;
        }
        ans.push_back(ret);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 66 ms 756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -