Compile Error,求助
查看原帖
Compile Error,求助
1058749
King_and_Grey楼主2023/12/30 20:59
#include <bits/stdc++.h>
using namespace std;
int main(){
    vector<int>v;
    int m,n,ans,i=1;
    cin>>m>>n;
    int a[n+5];
    while(cin>>a[i]){
        if(v.size+1>m){
            v.erase(v.begin());
        }
        if(v.find(v.begin(),v.end(),a[i])==v.end()){
            v.push_back(a[i]);
            ans++;
        }
        i++;
    }
    cout<<ans<<endl;
    return 0;
}

错哪了!?

2023/12/30 20:59
加载中...