Submission #430244

#TimeUsernameProblemLanguageResultExecution timeMemory
430244vulpes2Bubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9058 ms1484 KiB
//#include <atcoder/maxflow.hpp> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> #include <iostream> #include <map> #include <list> #include <set> #include <algorithm> #include <vector> #include <string> #include <functional> #include <queue> #include <deque> #include <stack> #include <unordered_map> #include <unordered_set> #include <cmath> #include <iterator> #include <random> #include <chrono> #include <complex> #include <bitset> #include <fstream> #define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i) #define set_map_includes(set, elt) (set.find((elt)) != set.end()) #define readint(i) int i; cin >> i #define readll(i) ll i; cin >> i #define readdouble(i) double i; cin >> i #define readstring(s) string s; cin >> s typedef long long ll; //using namespace __gnu_pbds; //using namespace atcoder; using namespace std; const ll modd = (1000LL * 1000LL * 1000LL + 7LL); //const ll modd = 998244353; std::vector<int> countScans(std::vector<int> A,std::vector<int> X,std::vector<int> V){ int Q=X.size(); std::vector<int> answer(Q); for (int j=0;j<Q;j++) { A[X[j]] = V[j]; int ans = 0; vector<int> a_copy(A.begin(), A.end()); sort(a_copy.begin(), a_copy.end()); forr(i,0,A.size()) { int k = upper_bound(a_copy.begin(), a_copy.end(), A[i]) - a_copy.begin(); --k; ans = max(ans, i-k); } answer[j]=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:29:53: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 | #define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
      |                                                     ^
bubblesort2.cpp:54:9: note: in expansion of macro 'forr'
   54 |         forr(i,0,A.size()) {
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...