#include<bits/stdc++.h>
using namespace std;
#define pb push_back
using lli=long long int;
#define endl '\n'
vector<int> countScans(vector<int> A,vector<int> X,vector<int> V){
int n=A.size();
int q=X.size();
vector<int> sv;
for(int i=0; i<q; ++i){
A[X[i]]=V[i];
int ans=0;
for(int j=0; j<n; ++j){
int aux=0;
for(int k=0; k<j; ++k){
if(A[k]>A[j]){
aux++;
}
}
ans=max(ans, aux);
}
sv.pb(ans);
}
return sv;
}
//Grader Malo
/*
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
lli t=1;
//cin>>t;
while(t--){
int n,q;
cin>>n>>q;
vector<int> A (n);
for(int i=0; i<n; ++i){
cin>>A[i];
}
vector<int> X(q);
vector<int> V(q);
for(int i=0; i<q; ++i){
cin>>X[i]>>V[i];
}
vector<int> ans=countScans(A,X,V);
for(int x: ans){
cout<<x<<endl;
}
}
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
344 KB |
Output is correct |
2 |
Correct |
165 ms |
348 KB |
Output is correct |
3 |
Correct |
2489 ms |
512 KB |
Output is correct |
4 |
Correct |
2457 ms |
524 KB |
Output is correct |
5 |
Correct |
2354 ms |
604 KB |
Output is correct |
6 |
Correct |
2385 ms |
520 KB |
Output is correct |
7 |
Correct |
2454 ms |
508 KB |
Output is correct |
8 |
Correct |
2414 ms |
504 KB |
Output is correct |
9 |
Correct |
2373 ms |
504 KB |
Output is correct |
10 |
Correct |
2456 ms |
496 KB |
Output is correct |
11 |
Correct |
2422 ms |
500 KB |
Output is correct |
12 |
Correct |
2454 ms |
512 KB |
Output is correct |
13 |
Correct |
2449 ms |
348 KB |
Output is correct |
14 |
Correct |
2418 ms |
516 KB |
Output is correct |
15 |
Correct |
2411 ms |
348 KB |
Output is correct |
16 |
Correct |
2335 ms |
344 KB |
Output is correct |
17 |
Correct |
2293 ms |
344 KB |
Output is correct |
18 |
Correct |
2334 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
344 KB |
Output is correct |
2 |
Correct |
165 ms |
348 KB |
Output is correct |
3 |
Correct |
2489 ms |
512 KB |
Output is correct |
4 |
Correct |
2457 ms |
524 KB |
Output is correct |
5 |
Correct |
2354 ms |
604 KB |
Output is correct |
6 |
Correct |
2385 ms |
520 KB |
Output is correct |
7 |
Correct |
2454 ms |
508 KB |
Output is correct |
8 |
Correct |
2414 ms |
504 KB |
Output is correct |
9 |
Correct |
2373 ms |
504 KB |
Output is correct |
10 |
Correct |
2456 ms |
496 KB |
Output is correct |
11 |
Correct |
2422 ms |
500 KB |
Output is correct |
12 |
Correct |
2454 ms |
512 KB |
Output is correct |
13 |
Correct |
2449 ms |
348 KB |
Output is correct |
14 |
Correct |
2418 ms |
516 KB |
Output is correct |
15 |
Correct |
2411 ms |
348 KB |
Output is correct |
16 |
Correct |
2335 ms |
344 KB |
Output is correct |
17 |
Correct |
2293 ms |
344 KB |
Output is correct |
18 |
Correct |
2334 ms |
512 KB |
Output is correct |
19 |
Execution timed out |
9058 ms |
604 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
9054 ms |
604 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
344 KB |
Output is correct |
2 |
Correct |
165 ms |
348 KB |
Output is correct |
3 |
Correct |
2489 ms |
512 KB |
Output is correct |
4 |
Correct |
2457 ms |
524 KB |
Output is correct |
5 |
Correct |
2354 ms |
604 KB |
Output is correct |
6 |
Correct |
2385 ms |
520 KB |
Output is correct |
7 |
Correct |
2454 ms |
508 KB |
Output is correct |
8 |
Correct |
2414 ms |
504 KB |
Output is correct |
9 |
Correct |
2373 ms |
504 KB |
Output is correct |
10 |
Correct |
2456 ms |
496 KB |
Output is correct |
11 |
Correct |
2422 ms |
500 KB |
Output is correct |
12 |
Correct |
2454 ms |
512 KB |
Output is correct |
13 |
Correct |
2449 ms |
348 KB |
Output is correct |
14 |
Correct |
2418 ms |
516 KB |
Output is correct |
15 |
Correct |
2411 ms |
348 KB |
Output is correct |
16 |
Correct |
2335 ms |
344 KB |
Output is correct |
17 |
Correct |
2293 ms |
344 KB |
Output is correct |
18 |
Correct |
2334 ms |
512 KB |
Output is correct |
19 |
Execution timed out |
9058 ms |
604 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |