在说洛谷有bug之前请先看看你自己的程序有没有bug。
by λᴉʍ @ 2017-10-18 21:50:24
绝对没有
@ XZZ\_\_233
by Harry_Potter @ 2017-10-18 21:53:40
运行时间有BUG也是TLE啊
by xgzc @ 2017-10-18 21:56:10
TLE是什么?
by Harry_Potter @ 2017-10-19 20:20:54
@[电脑达人](/space/show?uid=54832) RE是Runtime Error,是指运行错误
TLE是Time Limit Exceed,是指超时
两者不一样的,你看看你的程序有没有类似数组开太小,下标为负之类爆栈爆内存的运行错误
by NF水饺 @ 2017-10-25 12:39:32
```cpp
#include<vector>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int m,n,word,ans=0;
vector<int> dic;//向量
scanf("%d%d",&m,&n);
for(int i=0;i<n;i++)
{
scanf("%d",&word);
if(find(dic.begin(),dic.end(),word)==dic.end())//没找到
{
dic.push_back(word);//添加至内存
ans++;
if(dic.size()>m)dic.erase(dic.begin());//删除
}
}
printf("%d",ans);
return 0;
}
```
by hhz007 @ 2017-11-01 12:30:09
你来试试
by hhz007 @ 2017-11-01 12:30:24