Submission #590619

#TimeUsernameProblemLanguageResultExecution timeMemory
590619UncoolAnonBubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9022 ms552 KiB
#include <bits/stdc++.h> 
#define pii pair<int,int> 
#define F first 
#define S second 
#define mp make_pair 
#define endl '\n'
using namespace std; 
const int inf=1e9,N=2e5+5,md=1e9+7; 
vector<int> countScans(vector<int> a ,vector<int> x , vector<int> v){
	vector<int> answer(x.size());
	for(int i=0;i<x.size();i++){
		a[x[i]]=v[i]; 
		int mn=1e9+1; 
		for(int j=a.size()-1;j>-1;--j){
			mn=min(mn,a[j]);
			int cur=0;  
			for(int k=0;k<j;k++)
				if(a[k]>mn)
					cur++; 
			answer[i]=max(answer[i],cur ); 
		}
	}
	return answer; 
}

Compilation message (stderr)

bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:11:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for(int i=0;i<x.size();i++){
      |              ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...