#include <iostream>
using namespace std;
int a[250];
int main() {
int n, q;
cin >> n >> q;
for(int i = 1; i <= n; i++) cin >> a[i];
while(q--){
int type, pos, x;
cin >> type >> pos >> x;
if(type == 1){
a[pos] = x;
}
else{
int cnt = 0;
for(int i = 1; i <= pos; i++){
if(a[i] == x) cnt++;
}
cout << cnt << endl;
}
}
}
一看这个数据范围, 什么也不想了, 果断暴力模拟!

京公网安备 11010502036488号