Submission #852106

#TimeUsernameProblemLanguageResultExecution timeMemory
852106MrDebooBubble Sort 2 (JOI18_bubblesort2)C++17
38 / 100
9023 ms2672 KiB
#include "bubblesort2.h" #include "bits/stdc++.h" using namespace std; std::vector<int> countScans(std::vector<int> a,std::vector<int> x,std::vector<int> v){ vector<int>answer; for (int j=0;j<x.size();j++) { a[x[j]]=v[j]; vector<pair<int,int>>voc; for(int i=0;i<a.size();i++){ voc.push_back({a[i],i}); } sort(voc.begin(),voc.end()); int ans=0; for(int i=0;i<a.size();i++)ans=max(ans,voc[i].second-i); answer.push_back(ans); } return answer; }

Compilation message (stderr)

bubblesort2.cpp: In function 'std::vector<int> countScans(std::vector<int>, std::vector<int>, std::vector<int>)':
bubblesort2.cpp:6:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |  for (int j=0;j<x.size();j++) {
      |               ~^~~~~~~~~
bubblesort2.cpp:9:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   for(int i=0;i<a.size();i++){
      |               ~^~~~~~~~~
bubblesort2.cpp:14:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |   for(int i=0;i<a.size();i++)ans=max(ans,voc[i].second-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...