记录编号 | 552738 | 评测结果 | AAAAAAAAAA | ||
---|---|---|---|---|---|
题目名称 | 518.[NOIP 2010]机器翻译 | 最终得分 | 100 | ||
用户昵称 | 是否通过 | 通过 | |||
代码语言 | C++ | 运行时间 | 0.000 s | ||
提交时间 | 2020-08-05 09:23:03 | 内存使用 | 0.00 MiB | ||
#include <bits/stdc++.h> using namespace std; int m,n,c[1005],f[1005]; int x,s,t,t2; int translate123(){ freopen("translate.in","r",stdin); freopen("translate.out","w",stdout); scanf("%d%d",&m,&n); for(int i=1;i<=n;i++){ scanf("%d",&x); if(!c[x]){ s++; if(t<m){ t++;t2++; c[x]=1; f[t2]=x; } else{ t2++; c[f[t2-m]]=0; c[x]=1; f[t2]=x; } } } printf("%d",s); return 0; } int huhu=translate123(); int main(){;}