Em nộp bài này thì nó lại sai 2 test, em chả hiểu tại sao, mọi người tìm lỗi giúp em với ạ. Em cảm ơn 
#include <bits/stdc++.h>
using namespace std;
int main () {
ios::sync_with_stdio(false);
// freopen ("NUMDIF.inp", "r", stdin);
// freopen ("NUMDIF.out", "w", stdout);
int sl;
cin >> sl;
vector <int> a (sl);
vector <int> b;
vector <int> c (sl, 0);
int max = INT_MIN;
for (int i =0; i<a.size();i++) {
cin >> a[i];
if (a[i] > max) {
max = a[i]+1;
c.resize(max);
c[a[i]] = 0;
}
c[a[i]]++;
if (c[a[i]]==1) b.push_back(a[i]);
}
cout << b.size();
return 0;
}
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?