Submission #576294

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5762942022-06-13 00:41:29eecsSwap Swap Sort (CCO21_day1problem1)C++17
11 / 25
5090 ms148212 KiB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, m, q, a[maxn], p[maxn];
vector<int> V[maxn];
namespace BIT {
int c[maxn];
void add(int p, int v) {
for (; p <= m; p += p & -p) c[p] += v;
}
int query(int p) {
int s = 0;
for (; p; p -= p & -p) s += c[p];
return s;
}
} // namespace BIT
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n >> m >> q;
for (int i = 1; i <= n; i++) {
cin >> a[i], V[a[i]].push_back(i);
}
iota(p + 1, p + m + 1, 1);
long long ans = 0;
for (int i = n; i; i--) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...