/**
Baktiyar™
respa gold Soon.....
**/
#include <bits/stdc++.h>
using namespace std ;
#define ent '\n'
#define F first
#define S second
#define no "NO\n"
#define yes "YES\n"
#define pb push_back
#define pf push_front
#define sz(w) w.size()
#define int long long
#define all(w) w.begin() , w.end()
#define DH ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int mod = 1e9 + 6 , MOD = 1e9 + 7 , N = 1e6 + 11 , inf = 1e9 + 111 , INF = 1e18 , LG = 20 , M = 555 ;
/**
int gcd (int a, int b) {
while (b) {
a %= b;
swap (a, b);
}
return a;
}
**/
bool comp(pair<int,int> a, pair<int,int> b){
return a.F+a.S < b.F+b.S;
}
/**int MEX(set<int>& s) {
int mex = 0;
while (s.count(mex)) {
mex++;
}
return mex;
}
**/
void accepted() {
int n , q ;
cin >> n >> q ;
int a[n + 1] ;
for (int i = 1 ; i <= n ; i++) {
cin >> a[i] ;
}
while (q--) {
int t ;
cin >> t ;
if (t == 1) {
int i , val ;
cin >> i >> val ;
a[i] = val ;
}
if (t == 2) {
int x ,c = 0 ;
cin >> x ;
for (int i = 1 ; i <= n ; i++) {
if (a[i] <= x) {
c++;
}
}
cout << c << ent ;
}
}
}
signed main()
{
DH
//freopen( "input.in" , "r" , stdin ) ;
//freopen( "output.out" , "w" , stdout ) ;
int T = 1 ;
//cin >> T ;
while( T -- )
{
accepted() ;
cout << ent ;
}
}
/**
I❤️U
**/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |