Untitled
unknown
c_cpp
2 years ago
321 B
8
Indexable
long count = 0;
int minIndex = -1, maxIndex = -1;
for(int i=0;i<prices.size();++i)
{
if(maxIndex == -1 && prices[i] == maxPrice)
maxIndex = i;
if(prices[i] == minPrice)
minIndex = i;
}
cout<<(maxIndex+1)*(prices.size()-minIndex)<<endl;
return 0;Editor is loading...
Leave a Comment