#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
ll n, m; cin >> n >> m;
vector<ll> v(n);
for(ll i = 0; i < n; ++i){
cin >> v[i];
}
ll ans = 0;
while(m--){
ll pos; cin >> pos;
if(pos == 1){
ll a, b; cin >> a >> b;
for(ll i = 0; i < n; ++i){
if(v[i] == a){
v[i] = b;
break;
}
}
}
else{
ans = 0;
ll k; cin >> k;
for(ll i = 0; i < n; ++i){
if(v[i] <= k){
ans++;
}
}
cout << ans << "\n";
}
}
}
int main() {
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |