#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using ld = long double;
#define all(x) (x).begin(),(x).end()
const int MN = 1e5 + 5, MOD = 1e9 + 7, BASE = 131;
vector<int> countScans (vector<int> A, vector<int> X, vector<int> V) {
int n = A.size();
vector<int> ret(n);
int q = X.size();
for (int j = 0; j < q; j++) {
A[X[j]] = V[j];
vector<pii> na(n);
for (int i = 0; i < n; i++) na[i] = {A[i],i};
stable_sort(all(na),[](const pii &a, const pii &b){return a.first < b.first;});
int ans = 0;
for (int i = 0; i < n; i++) ans = max(ans,na[i].second-i);
ret[j] = ans;
}
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
16 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
16 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3846 ms |
1520 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
16 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |