[第1章 1.2t6] 机器翻译-NOIP
39 字
1 分钟
[第1章 1.2t6] 机器翻译-NOIP
#include <bits/stdc++.h>using namespace std;typedef long long ll;queue<ll> qq;vector<ll> hh(1010,0);int main(){ ll m,n; cin>>m>>n; ll cnt=0; for(ll i=0;i<n;i++){ ll t; cin>>t; if(!hh[t]){ hh[t]=1; qq.push(t); cnt++; while(qq.size()>m){ hh[qq.front()]=0; qq.pop(); } } } cout<<cnt<<endl; return 0;}支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!




