제출 #852246

#제출 시각아이디문제언어결과실행 시간메모리
852246vjudge1Bubble Sort 2 (JOI18_bubblesort2)C++17
17 / 100
9038 ms1624 KiB
#include <bits/stdc++.h> //#define int long long #define ll long long #define endl '\n' #define pii pair<int,int> #define vint vector<int> #define vll vector<ll> #define vpii vector<pii> #define pb push_back #define se second #define fi first #define all(x) x.begin(), x.end() #define graph vector<vll> using namespace std; const int N = (int)2e5 + 69; const int mod = (int)1e4 + 7; const int naser = 3999, tourist = 3816; int power(int a, int b) { int ans = 1; while (b) { if (b % 2) ans *= a; a *= a; b /= 2; } return ans; } vint countScans(vint a, vint x, vint v) { int n = a.size(); int q = x.size(); vint ans(q); for (int j = 0; j < q; j++) { a[x[j]] = v[j]; vint b = a; sort(all(b)); map<int, int> mp; for (int i = 0; i < n; i++) { mp[b[i]] = i; } for (int i = 0; i < n; i++) { if (i > mp[a[i]]) ans[j] = max(ans[j], i - mp[a[i]]); } } return ans; } //int32_t main() { // // vint ans = countScans({1,2,3,4}, {0,2}, {3,1}); // for (int x : ans) // cout << x << endl; // //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...