fork download
  1. #include "bubblesort2.h"
  2. #include <iostream>
  3. #include <iterator>
  4. #include <set>
  5. using namespace std;
  6. set<int> S;
  7. int Vec[500010];
  8. int Maxi[500010];
  9.  
  10.  
  11. int Solve(int a){
  12. int ans=0;
  13. for(int i=0;i<a;i++){
  14. if(Vec[i]>Vec[a]) ans++;
  15. }
  16. return ans;
  17. }
  18.  
  19. vector<int> count_scans(vector<int> A,vector<int> X,vector<int> V){
  20. int Q=X.size();
  21. int n=A.size();
  22. vector<int> Answer;
  23. for(int i=0;i<n;i++){
  24. Vec[i]=A[i];
  25. Maxi[i]=Solve(i);
  26. }
  27. for(int i=0;i<Q;i++){
  28. int Nuevo=V[i];
  29. int Pos=X[i];
  30. int Antiguo=Vec[Pos];
  31. Vec[Pos]=Nuevo;
  32. Maxi[Pos]=Solve(Pos);
  33. for(int j=Pos+1;j<n;j++){
  34. int b=Vec[j];
  35. if(Antiguo>=b and Nuevo<b) Maxi[j]--;
  36. if(Antiguo<=b and Nuevo>b) Maxi[j]++;
  37. }
  38. int MAXIMO=0;
  39. for(int i=0;i<n;i++){
  40. MAXIMO=max(MAXIMO,Maxi[i]);
  41. }
  42. Answer.push_back(MAXIMO);
  43. }
  44. return Answer;
  45. }
  46.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:25: fatal error: bubblesort2.h: No such file or directory
 #include "bubblesort2.h"
                         ^
compilation terminated.
stdout
Standard output is empty