This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,m,i,c,h,l,r,a[100005],ans;
char type;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> m;
for(i=1;i<=n;i++){
cin >> a[i];
}
sort(a+1,a+n+1);
while(m--){
cin >> type;
if(type=='F'){
cin >> c >> h;
for(i=1;i<=n;i++){
if(a[i]>=h && c>0){
a[i]++;
c--;
}
}
sort(a+1,a+n+1);
}
else{
cin >> l >> r;
ans=0;
for(i=1;i<=n;i++){
if(a[i]>=l && a[i]<=r) ans++;
}
cout << ans << "\n";
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |