Pagini recente » Cod sursa (job #2470437) | Cod sursa (job #2933555) | Cod sursa (job #1133083) | Cod sursa (job #2313392) | Cod sursa (job #3123960)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("secv5.in");
ofstream fout("secv5.out");
int N,L,U,v[10000000],S,nr,n;
vector<int> elemente;
int main()
{
fin>>N>>L>>U;
for(int i=0; i<N ;i++)
{
fin>>v[i];
}
for(int i=0 ; i<N ;i++)
{
elemente.clear();
elemente.push_back(v[i]);
S=1;
if(S<=U && S>=L)
{
nr++;
}
for(int j=i+1 ;j<N;j++)
{
if (count(elemente.begin(), elemente.end(), v[j])==0)
{
S++;
}
elemente.push_back(v[j]);
if(S<=U && S>=L)
{
nr++;
}
}
}
fout<<nr;
}