Submission #163902

# Submission time Handle Problem Language Result Execution time Memory
163902 2019-11-16T06:45:38 Z oolimry Bubble Sort 2 (JOI18_bubblesort2) C++14
0 / 100
3012 ms 604 KB
//#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> countScans(vector<int> arr, vector<int> X, vector<int> V){
	int q = X.size();
	int n = arr.size();
	vector<int> answer;
	for(int i = 0;i < n;i++){
		arr[i] *= -1;
	}
	for(int qq = 0;qq < q;qq++){
		arr[X[qq]] = V[qq] * -1;
		vector<int> L;
		for(int i = 0;i < n;i++){
			int a = arr[i];
			int index = lower_bound(L.begin(), L.end(),a) - L.begin();
			if(index == L.size()){
				L.push_back(a);
				continue;
			}
			L[index] = a;
		}
		answer.push_back(L.size() - 1);
	}
	return answer;
}


Compilation message

bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:18:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if(index == L.size()){
       ~~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3012 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -