제출 #1159738

#제출 시각아이디문제언어결과실행 시간메모리
1159738Der_VlaposBubble Sort 2 (JOI18_bubblesort2)C++20
0 / 100
48 ms676 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) { int n = a.size(); int q = x.size(); std::vector<int> answer(q); for (int j = 0; j < q; j++) { a[x[j]] = v[j]; int mn = 1e9 + 10; int cnt = 0; for (int i = n - 1; i >= 0; --i) { cnt += (a[i] > mn); mn = min(mn, a[i]); } answer[j] = cnt; } return answer; } // #include "bubblesort2.h" // #include <cstdio> // #include <cstdlib> // #include <vector> // int readInt(){ // int i; // if(scanf("%d",&i)!=1){ // fprintf(stderr,"Error while reading input\n"); // exit(1); // } // return i; // } // int main(){ // int N,Q; // N=readInt(); // Q=readInt(); // std::vector<int> A(N); // for(int i=0;i<N;i++) // A[i]=readInt(); // std::vector<int> X(Q),V(Q); // for(int j=0;j<Q;j++){ // X[j]=readInt(); // V[j]=readInt(); // } // std::vector<int> res=countScans(A,X,V); // for(int j=0;j<int(res.size());j++) // printf("%d\n",res[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...