Submission #1054670

#TimeUsernameProblemLanguageResultExecution timeMemory
1054670aymanrsBubble Sort 2 (JOI18_bubblesort2)C++17
0 / 100
1128 ms760 KiB
#include "bubblesort2.h" #include <bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace std; std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){ int Q=X.size(); std::vector<int> ans(Q); int n = A.size(); for (int _=0;_<Q;_++) { A[X[_]] = V[_]; vector<int> v = {0}; for(int i = 0;i < n;i++) { bool f = false; for(int j = 0;j < v.size();j++){ if(v[j] <= A[i]) { f=true; v[j]=A[i]; break; } } if(!f) v.push_back(A[i]); } ans[_] = v.size()-1; } return ans; }

Compilation message (stderr)

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