#include<fstream>
#include<queue>
using namespace std;
const int N(1001);
bool used[N]={0};
int main()
{
queue<int> q;
int n,m,word,sum=0;
ifstream cin("translate.in");
ofstream cout("translate.out");
cin>>m>>n;
for (int i=0;i<n;i++)
{
cin>>word;
if (!used[word])
{
sum++;
q.push(word);
used[word]=true;
if (q.size()>m) {
used[q.front()]=false;
q.pop();
}
}
}
cout<<sum<<endl;
return 0;
}
posted on 2012-06-20 11:20
龙在江湖 阅读(487)
评论(0) 编辑 收藏 引用 所属分类:
竞赛题解_NOIP