problem
solution
codes
//STL大法好
#include<iostream>
#include<set>
#include<queue>
using namespace std;
queue<int>q;
set<int>s;
int main(){
int m, n, ans = 0;
cin>>m>>n;
for(int i = 1; i <= n; i++){
int x; cin>>x;
if(s.count(x))continue;
else{
ans++;
q.push(x); s.insert(x);
if(q.size()> m){
s.erase(q.front());
q.pop();
}
}
}
cout<<ans<<"
";
return 0;
}