#include #include #include #include #include #include using namespace std; int candleCount; vector candleHeight; int maxHeight = 0; int candlesOnHeight = 0; int main() { //scan candle count cin >> candleCount; //scan candle heights string candleHeightIterator; for (int i = 0; i < candleCount; i++) { cin >> candleHeightIterator; candleHeight.push_back(stoi(candleHeightIterator)); } for (int i = 0; i < candleHeight.size(); i++) { int currentHeight = candleHeight[i]; if (currentHeight > maxHeight) { maxHeight = currentHeight; candlesOnHeight = 1; } else if (currentHeight == maxHeight) { candlesOnHeight++; } } cout << candlesOnHeight << endl; return 0; }